:root {
  --void: #08070a;
  --deep: #0f0c10;
  --panel: rgba(21, 16, 25, 0.92);
  --panel-solid: #151019;
  --wood: #4d3528;
  --copper: #a8663f;
  --amber: #d8a95b;
  --amber-dim: #8a6a35;
  --violet: #9464ff;
  --violet-soft: #c6b5ff;
  --cyan: #55c7d5;
  --cyan-dim: #2a6f7a;
  --magenta: #9464ff;
  --blue: #6a5a8a;
  --text: #eee8df;
  --muted: #998f91;
  --error: #e36a68;
  --ok: #7cb88a;
  --glow-cyan: 0 0 10px rgba(85, 199, 213, 0.25);
  --glow-violet: 0 0 12px rgba(148, 100, 255, 0.35), 0 0 28px rgba(148, 100, 255, 0.12);
  --glow-amber: 0 0 10px rgba(216, 169, 91, 0.28);
  --border: rgba(168, 102, 63, 0.45);
  --border-soft: rgba(148, 100, 255, 0.28);
  --border-metal: rgba(180, 160, 140, 0.22);
  --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;
  --z-security: 300;
  --security-bg: #060508;
  --security-panel: #151019;
  --security-primary: #9464ff;
  --security-secondary: #d8a95b;
  --security-text: #eee8df;
  --security-muted: #998f91;
  --security-success: #7cb88a;
  --security-error: #e36a68;
}

*,
*::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 (atelier Faubourgs) —— */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 18% 22%, rgba(148, 100, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 45% 35% at 78% 30%, rgba(216, 169, 91, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 55% 85%, rgba(77, 53, 40, 0.35), transparent 55%),
    linear-gradient(180deg, #121014 0%, var(--void) 45%, #050406 100%);
  overflow: hidden;
}

.atmosphere .plate-layer {
  position: absolute;
  inset: 8% 6% 18% 4%;
  background:
    linear-gradient(135deg, rgba(21, 16, 25, 0.55) 0%, transparent 40%),
    linear-gradient(0deg, rgba(30, 24, 28, 0.4), rgba(21, 16, 25, 0.15));
  border: 1px solid var(--border-metal);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(10, 8, 10, 0.4);
  clip-path: polygon(
    0 8px,
    8px 0,
    calc(100% - 8px) 0,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0 calc(100% - 8px)
  );
  opacity: 0.55;
}

.atmosphere .cable-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 12%, rgba(168, 102, 63, 0.18) 12.2%, transparent 12.5%),
    linear-gradient(18deg, transparent 62%, rgba(148, 100, 255, 0.12) 62.3%, transparent 62.6%),
    linear-gradient(-12deg, transparent 40%, rgba(77, 53, 40, 0.25) 40.2%, transparent 40.5%);
  opacity: 0.7;
}

.atmosphere .wood-grain {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(77, 53, 40, 0.08) 0,
      rgba(77, 53, 40, 0.08) 2px,
      transparent 2px,
      transparent 11px
    ),
    linear-gradient(180deg, transparent, rgba(77, 53, 40, 0.22));
  mask-image: linear-gradient(180deg, transparent, #000 40%);
  opacity: 0.65;
}

.atmosphere .rivet-field {
  position: absolute;
  inset: 10% 8%;
  background-image: radial-gradient(circle, rgba(168, 102, 63, 0.45) 1px, transparent 1.5px);
  background-size: 72px 64px;
  background-position: 12px 10px;
  opacity: 0.35;
}

.atmosphere .lamp-warm {
  position: absolute;
  width: 42%;
  height: 38%;
  right: -5%;
  top: 8%;
  background: radial-gradient(ellipse at center, rgba(216, 169, 91, 0.2), transparent 70%);
  filter: blur(2px);
}

.atmosphere .electrope-glow {
  position: absolute;
  width: 36%;
  height: 42%;
  left: -4%;
  top: 18%;
  background: radial-gradient(ellipse at center, rgba(148, 100, 255, 0.22), transparent 68%);
}

.atmosphere .dust-layer {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(238, 232, 223, 0.12) 0.6px, transparent 0.8px);
  background-size: 7px 7px;
  opacity: 0.2;
}

.atmosphere .scratch-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(128deg, transparent 20%, rgba(238, 232, 223, 0.04) 20.2%, transparent 20.5%),
    linear-gradient(-35deg, transparent 70%, rgba(0, 0, 0, 0.15) 70.3%, transparent 70.6%);
  opacity: 0.5;
}

.grid-floor,
.neon-haze,
.scanlines {
  display: none;
}

/* —— 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(440px, 58vw);
  z-index: 2;
}

.site-name {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(0.72rem, 2vw, 0.95rem);
  letter-spacing: 0.12em;
  color: var(--amber);
  text-shadow: var(--glow-amber);
}

.site-sub {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--violet-soft);
  letter-spacing: 0.08em;
}

.site-session {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.status-badges {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.28rem;
}

.status-badges li {
  display: inline-block;
  padding: 0.18rem 0.45rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-metal);
  background: rgba(21, 16, 25, 0.75);
  color: var(--muted);
}

.status-badges .badge-ok {
  border-color: rgba(148, 100, 255, 0.4);
  color: var(--violet-soft);
}

.status-badges .badge-warn {
  border-color: rgba(216, 169, 91, 0.45);
  color: var(--amber);
}

.status-badges .badge-err {
  border-color: rgba(227, 106, 104, 0.45);
  color: var(--error);
}

.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;
}

.desk-icon.accent {
  border-color: rgba(148, 100, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(148, 100, 255, 0.15);
}

.desk-icon.accent .glyph {
  color: var(--violet-soft);
  border-color: rgba(148, 100, 255, 0.45);
  text-shadow: 0 0 8px rgba(148, 100, 255, 0.55);
}

.desk-icon.warn {
  border-color: rgba(216, 169, 91, 0.5);
}

.desk-icon.warn .code {
  color: var(--amber);
}

.desk-icon {
  width: 108px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.45rem 0.4rem 0.5rem;
  border: 1px solid var(--border-metal);
  background:
    linear-gradient(180deg, rgba(40, 32, 36, 0.75), rgba(21, 16, 25, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(238, 232, 223, 0.06),
    2px 3px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer;
  color: inherit;
  font: inherit;
  clip-path: polygon(
    0 4px,
    4px 0,
    calc(100% - 4px) 0,
    100% 4px,
    100% calc(100% - 4px),
    calc(100% - 4px) 100%,
    4px 100%,
    0 calc(100% - 4px)
  );
}

.desk-icon:hover,
.desk-icon:focus-visible {
  border-color: rgba(148, 100, 255, 0.55);
  outline: none;
  transform: translateY(-1px);
}

.desk-icon:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.35);
}

.desk-icon .glyph {
  align-self: flex-start;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(168, 102, 63, 0.4);
  background: rgba(8, 7, 10, 0.55);
  color: var(--copper);
  font-size: 0.85rem;
}

.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.68rem;
  letter-spacing: 0.06em;
  color: var(--text);
}

.desk-icon .label .code {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.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-solid);
  border: 1px solid var(--border);
  border-radius: 0;
  clip-path: polygon(
    0 7px,
    7px 0,
    calc(100% - 7px) 0,
    100% 7px,
    100% calc(100% - 7px),
    calc(100% - 7px) 100%,
    7px 100%,
    0 calc(100% - 7px)
  );
  box-shadow:
    4px 8px 0 rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(238, 232, 223, 0.04);
  overflow: hidden;
  animation: win-in 0.22s 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: rgba(148, 100, 255, 0.55);
  box-shadow:
    4px 8px 0 rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(148, 100, 255, 0.25),
    var(--glow-violet);
}

.window.minimized {
  display: none;
}

.win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background:
    linear-gradient(180deg, rgba(55, 42, 36, 0.95), rgba(30, 24, 28, 0.98));
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.win-titlebar:active {
  cursor: grabbing;
}

.win-titlebar::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.35rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 10px 0 0 var(--copper), 20px 0 0 rgba(168, 102, 63, 0.45);
  opacity: 0.7;
  pointer-events: none;
}

.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 {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border: 1px solid var(--border-metal);
  background: rgba(8, 7, 10, 0.9);
  cursor: pointer;
  text-align: left;
  padding: 0.45rem;
  color: inherit;
  font: inherit;
  width: 100%;
  clip-path: polygon(
    0 4px,
    4px 0,
    calc(100% - 4px) 0,
    100% 4px,
    100% calc(100% - 4px),
    calc(100% - 4px) 100%,
    4px 100%,
    0 calc(100% - 4px)
  );
}

.cam-tile.has-shot {
  background: #08070a;
}

.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: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 0.85rem;
  margin-bottom: 0.55rem;
  padding: 0.55rem;
  border: 1px solid var(--border-metal);
  background: rgba(8, 7, 10, 0.55);
}

.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 { display: none; }

.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(--ok);
}

.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(148, 100, 255, 0.12);
}

.log-row .lvl-info {
  color: var(--violet-soft);
}
.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(--violet-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.prompt .cwd {
  color: var(--amber);
}

#cmd {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  caret-color: var(--amber);
}

/* —— 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, #121014, #08070a);
  border-top: 3px solid var(--copper);
  box-shadow:
    0 -10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(238, 232, 223, 0.05);
}

.term-dock-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.85rem;
  border-bottom: 1px solid rgba(77, 53, 40, 0.45);
  background: linear-gradient(90deg, rgba(77, 53, 40, 0.35), rgba(21, 16, 25, 0.9));
  font-family: var(--font-ui);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
  flex-shrink: 0;
}

.term-dock-diode {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 8px rgba(148, 100, 255, 0.7);
  flex-shrink: 0;
}

.term-vent {
  margin-left: auto;
  width: 72px;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    rgba(238, 232, 223, 0.12) 0,
    rgba(238, 232, 223, 0.12) 2px,
    transparent 2px,
    transparent 6px
  );
  opacity: 0.55;
}

.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);
}


/* —— Camera thumbnails (contain) —— */
.cam-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #050406;
  border: 1px solid rgba(77, 53, 40, 0.35);
  overflow: hidden;
}

.cam-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.cam-thumb-empty {
  color: var(--muted);
  font-size: 0.7rem;
}

.cam-tile-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.5rem;
  font-size: 0.7rem;
}

.cam-tile-info .badge {
  grid-column: 1 / -1;
  position: static;
  color: var(--violet-soft);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.cam-tile-info .cam-name { color: var(--text); }
.cam-tile-info .cam-dur { color: var(--amber); text-align: right; }
.cam-tile-info .cam-audio { color: var(--muted); }
.cam-tile-info .cam-status {
  grid-column: 1 / -1;
  color: var(--copper);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.cam-tile:hover {
  border-color: rgba(148, 100, 255, 0.5);
  box-shadow: var(--glow-violet);
}

.cam-tile .noise { display: none; }

/* —— Documents —— */
.doc-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--amber);
}

.doc-sub {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--violet-soft);
  font-weight: 500;
}

.doc-list {
  margin: 0.15rem 0;
  padding-left: 0.2rem;
  color: var(--text);
}

.doc-kv {
  display: grid;
  grid-template-columns: minmax(5rem, 9rem) 1fr;
  gap: 0.35rem;
  margin: 0.2rem 0;
}

.doc-k {
  color: var(--muted);
}

.doc-v {
  color: var(--text);
}

.doc-note {
  margin: 0.35rem 0;
  color: var(--muted);
  font-style: italic;
}

.doc-gap {
  margin: 0.2rem 0;
  line-height: 0.6;
}

/* —— Verrouillage CP-9 —— */
.session-locked .workspace-shell {
  visibility: hidden;
  pointer-events: none;
}

.session-unlocked .workspace-shell {
  visibility: visible;
  pointer-events: auto;
}

.security-lock {
  position: fixed;
  inset: 0;
  z-index: var(--z-security);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1rem;
  overflow: auto;
  background:
    radial-gradient(ellipse 50% 40% at 20% 20%, rgba(148, 100, 255, 0.16), transparent 55%),
    radial-gradient(ellipse 40% 35% at 80% 70%, rgba(216, 169, 91, 0.08), transparent 50%),
    var(--security-bg);
  color: var(--security-text);
  font-family: var(--font-mono);
}

.security-lock.is-unlocking {
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.security-lock-scratch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(125deg, transparent 30%, rgba(238, 232, 223, 0.03) 30.3%, transparent 30.6%),
    linear-gradient(-40deg, transparent 62%, rgba(0, 0, 0, 0.25) 62.4%, transparent 62.8%);
  opacity: 0.7;
}

.security-lock [data-lock-mount] {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  margin: auto;
}

.security-lock-panel {
  border: 1px solid rgba(168, 102, 63, 0.45);
  background: linear-gradient(180deg, rgba(30, 24, 28, 0.95), var(--security-panel));
  box-shadow:
    5px 8px 0 rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(238, 232, 223, 0.04);
  padding: 1rem 1.1rem 1.15rem;
  clip-path: polygon(
    0 10px,
    10px 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    10px 100%,
    0 calc(100% - 10px)
  );
}

.security-lock-header h1 {
  margin: 0.2rem 0 0;
  font-family: var(--font-ui);
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  letter-spacing: 0.1em;
  color: var(--security-secondary);
}

.security-lock-code {
  margin: 0;
  font-family: var(--font-ui);
  letter-spacing: 0.16em;
  color: var(--security-primary);
  font-size: 0.85rem;
}

.security-lock-session {
  margin: 0.25rem 0 0;
  color: var(--security-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.security-lock-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.security-lock-meta div {
  border: 1px solid rgba(148, 100, 255, 0.28);
  background: rgba(8, 7, 10, 0.45);
  padding: 0.35rem 0.45rem;
}

.security-lock-meta span {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--security-muted);
}

.security-lock-meta strong {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--security-text);
}

.security-lock-message {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.6rem;
  border-left: 3px solid var(--security-secondary);
  background: rgba(8, 7, 10, 0.45);
  color: var(--security-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.security-lock-message.phase-error {
  border-left-color: var(--security-error);
  color: var(--security-error);
}

.phase-layout {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(200px, 1.1fr) minmax(180px, 0.9fr);
  gap: 0.75rem;
  margin-top: 0.85rem;
  align-items: start;
}

.phase-reference {
  border: 1px solid rgba(168, 102, 63, 0.4);
  background: rgba(8, 7, 10, 0.5);
  padding: 0.5rem;
}

.phase-reference-title {
  margin: 0 0 0.45rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--security-muted);
}

.phase-reference-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.phase-reference-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(238, 232, 223, 0.06);
  padding-bottom: 0.3rem;
}

.phase-reference-ring {
  font-size: 0.62rem;
  color: var(--security-muted);
  letter-spacing: 0.04em;
}

.phase-reference .phase-symbol {
  width: 28px;
  height: 28px;
  color: var(--security-secondary);
  display: grid;
  place-items: center;
}

.phase-reference .phase-symbol svg {
  width: 24px;
  height: 24px;
}

.phase-matrix-wrap {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1px solid rgba(148, 100, 255, 0.28);
  background: rgba(8, 7, 10, 0.55);
}

.phase-matrix {
  width: min(100%, 300px);
  height: auto;
}

.phase-orbit {
  stroke: rgba(168, 102, 63, 0.45);
  stroke-width: 1.2;
}

.phase-read-line {
  stroke: var(--security-secondary);
  stroke-width: 1.4;
  stroke-dasharray: 4 3;
  opacity: 0.85;
}

.phase-core {
  fill: rgba(0, 0, 0, 0.35);
  stroke: var(--security-primary);
  stroke-width: 2;
  transition: fill 0.35s, stroke 0.35s, filter 0.35s;
}

.phase-core-inner {
  fill: var(--security-primary);
  opacity: 0.55;
  transition: fill 0.35s, opacity 0.35s;
}

.phase-symbol {
  color: var(--security-text);
  opacity: 0.7;
}

.phase-seg.on-line .phase-symbol {
  opacity: 1;
  color: var(--security-secondary);
  filter: drop-shadow(0 0 4px rgba(216, 169, 91, 0.4));
}

.phase-ring.is-locked .phase-orbit {
  stroke: var(--security-success);
}

.phase-ring.is-hinted .phase-orbit {
  stroke: var(--security-secondary);
  stroke-width: 2;
}

.phase-solved-preview .phase-core,
.phase-success .phase-core {
  stroke: var(--security-success);
  fill: rgba(124, 184, 138, 0.2);
  filter: drop-shadow(0 0 10px rgba(124, 184, 138, 0.45));
}

.phase-success .phase-core-inner {
  fill: var(--security-success);
  opacity: 0.9;
}

.phase-progress-label {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--security-muted);
}

.phase-progress-track {
  height: 8px;
  border: 1px solid rgba(148, 100, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.phase-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--security-primary), var(--security-secondary));
  transition: width 0.25s ease;
}

.phase-coupling-hint {
  margin: 0.55rem 0 0.45rem;
  font-size: 0.62rem;
  color: var(--security-muted);
  line-height: 1.35;
}

.phase-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.phase-ring-controls {
  border: 1px solid rgba(148, 100, 255, 0.25);
  background: rgba(8, 7, 10, 0.45);
  padding: 0.4rem 0.45rem;
}

.phase-ring-controls.is-locked {
  border-color: rgba(124, 184, 138, 0.55);
}

.phase-ring-label {
  margin: 0;
  font-size: 0.72rem;
  color: var(--security-primary);
}

.phase-ring-state {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.62rem;
  color: var(--security-muted);
}

.phase-ring-btns {
  display: flex;
  gap: 0.35rem;
}

.phase-rot {
  flex: 1;
  border: 1px solid rgba(168, 102, 63, 0.4);
  background: rgba(0, 0, 0, 0.28);
  color: var(--security-text);
  cursor: pointer;
  padding: 0.35rem;
  font: inherit;
}

.phase-rot:hover:not(:disabled),
.phase-rot:focus-visible {
  border-color: var(--security-primary);
  outline: 1px solid var(--security-primary);
}

.phase-rot:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.phase-validation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.phase-btn {
  border: 1px solid rgba(168, 102, 63, 0.45);
  background: rgba(8, 7, 10, 0.5);
  color: var(--security-text);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.04em;
}

.phase-btn.primary.is-ready {
  border-color: var(--security-success);
  color: var(--security-success);
  box-shadow: 0 0 12px rgba(124, 184, 138, 0.25);
}

.phase-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.phase-btn.phase-assist {
  border-color: var(--security-secondary);
  color: var(--security-secondary);
}

.phase-btn:focus-visible {
  outline: 2px solid var(--security-primary);
  outline-offset: 2px;
}

.phase-log {
  margin-top: 0.75rem;
  max-height: 130px;
  overflow: auto;
  border-top: 1px solid rgba(148, 100, 255, 0.22);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.phase-log-entry {
  border: 1px solid rgba(148, 100, 255, 0.22);
  background: rgba(8, 7, 10, 0.45);
  padding: 0.35rem 0.45rem;
}

.phase-log-entry p {
  margin: 0.1rem 0;
  font-size: 0.75rem;
}

.phase-log-entry.phase-error {
  border-color: var(--security-error);
  color: var(--security-error);
}

.phase-log-entry.phase-ok {
  border-color: var(--security-success);
  color: var(--security-success);
}

.phase-log-entry.phase-assist {
  border-color: var(--security-secondary);
  color: var(--security-secondary);
}

.phase-final-msg {
  margin: 0.65rem 0 0;
  text-align: center;
  letter-spacing: 0.1em;
  color: var(--security-success);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.phase-puzzle.phase-error-flash {
  animation: phase-desync 0.4s ease;
}

@keyframes phase-desync {
  0%,
  100% {
    filter: none;
  }
  40% {
    filter: hue-rotate(-10deg) brightness(0.92);
  }
}

.site-auth {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--violet-soft);
}

@media (max-width: 860px) {
  .phase-layout {
    grid-template-columns: 1fr;
  }

  .security-lock-meta {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .security-lock.is-unlocking {
    transition: none;
  }

  .phase-progress-fill,
  .phase-core,
  .phase-core-inner {
    transition: none;
  }

  .phase-puzzle.phase-error-flash {
    animation: none;
  }
}

/* —— 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 {
  position: relative;
  pointer-events: auto;
  padding: 0.55rem 1.6rem 0.55rem 0.7rem;
  border: 1px solid var(--border-metal);
  background: rgba(21, 16, 25, 0.95);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.4);
  animation: notify-in 0.25s ease-out;
}

.notify.clickable { cursor: pointer; }
.notify.clickable:hover { border-color: rgba(148, 100, 255, 0.5); }

.notify.leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
}

.notify-text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.35;
}

.notify-close {
  position: absolute;
  top: 0.2rem;
  right: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

@keyframes notify-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .notify,
  .window {
    animation: none !important;
    transition: none !important;
  }
}
