body.phase-b {
  color: var(--b-text);
  font-family: "Courier New", monospace;
  background: var(--b-bg);
  background-image: none;
}

.phase-b .site-footer {
  border-top-color: var(--b-border);
  color: #8fa7b6;
}
.phase-b .site-footer b {
  background: #0b141d;
  color: var(--b-success);
}

.system-shell {
  width: min(100%, 900px);
  margin: 0 auto;
}
.system-window {
  width: min(100%, 760px);
  background: var(--b-panel);
  border: 2px solid var(--b-border);
  box-shadow: 0 0 0 1px rgba(4,4,255,.16), 8px 8px 0 rgba(0,0,0,.22);
}
.system-bar {
  justify-content: space-between;
  background: #132231;
  color: var(--b-success);
  font-family: "Courier New", monospace;
}
.archive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 22px;
  padding: 28px;
}
.console {
  border-left: 4px solid var(--b-signal);
  padding-left: 18px;
  line-height: 1.75;
}
.console .meta { color: var(--b-success); }
.console h1,
.console h2 {
  color: #d8edf6;
  font-size: 34px;
}
.console p { color: #cfe1e8; }
.console .warn { color: var(--b-warn); }
.password-form {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--b-text);
}
.password-form input {
  min-width: 0;
  border: 1px solid var(--b-border);
  background: #0b141d;
  color: var(--b-success);
  padding: 6px;
  font-family: "Courier New", monospace;
}
.password-form button {
  justify-self: start;
  border: 1px solid var(--b-border);
  background: #172633;
  color: var(--b-text);
  padding: 7px 12px;
  cursor: pointer;
}
.popup-stack {
  position: relative;
  min-height: 220px;
}
.sys-pop {
  position: absolute;
  width: 176px;
  min-height: 72px;
  border: 1px solid var(--b-border);
  background: #172633;
  color: var(--b-text);
  padding: 30px 10px 10px;
  font-size: 13px;
  box-shadow: 6px 6px 0 rgba(0,0,0,.35);
}
.sys-pop::before {
  content: "|";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 22px;
  padding-left: 8px;
  background: var(--b-err);
  color: var(--b-success);
}
.p1 { left: 0; top: 0; }
.p2 { left: 18px; top: 48px; }
.p3 { left: 36px; top: 96px; color: var(--b-warn); }

.system-address { color: #8fa7b6; }
.system-address input {
  border-color: var(--b-border);
  background: #0b141d;
  color: var(--b-success);
  font-family: "Courier New", monospace;
}
.system-address button {
  border-color: var(--b-border);
  background: #172633;
  color: var(--b-text);
}

.corridor-wrap {
  min-height: 420px;
  padding: 0;
  overflow: hidden;
  background: #050c12;
  perspective: 520px;
}
.corridor-scene {
  position: relative;
  height: 420px;
  transform-style: preserve-3d;
  background: radial-gradient(circle at 50% 44%, rgba(95,214,200,.18), transparent 22%), #050c12;
}
.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86%;
  height: 70%;
  border: 2px solid rgba(184,202,214,.24);
  transform: translate(-50%, -50%) translateZ(var(--z));
  box-shadow: inset 0 0 18px rgba(95,214,200,.12);
  animation: drift 8s linear infinite;
}
.ring:nth-child(2) { --z: -90px; animation-delay: -1.3s; }
.ring:nth-child(3) { --z: -180px; animation-delay: -2.6s; }
.ring:nth-child(4) { --z: -270px; animation-delay: -3.9s; }
.ring:nth-child(5) { --z: -360px; animation-delay: -5.2s; }
.ring:nth-child(6) { --z: -450px; animation-delay: -6.5s; }
.door-plate {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  color: rgba(216,237,246,.84);
  font-family: "Courier New", monospace;
  letter-spacing: 0;
}
@keyframes drift {
  from { opacity: .15; }
  45% { opacity: .55; }
  to { opacity: .15; }
}
.end-log {
  padding: 26px 30px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.end-log h1 {
  color: #d8edf6;
  font-family: "Courier New", monospace;
  font-size: 26px;
  word-break: keep-all;
  overflow-wrap: normal;
}
.end-log p {
  color: #cfe1e8;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.end-log .next { color: var(--b-success); }

.system-table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  color: #cfe1e8;
  font-size: 14px;
  line-height: 1.6;
}
.system-table th,
.system-table td {
  border: 1px solid rgba(143,167,182,.35);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.system-table th {
  width: 138px;
  color: var(--b-success);
  font-weight: 400;
}
.system-pre,
.transcript {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(143,167,182,.35);
  background: #0b141d;
  color: #cfe1e8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.system-link-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.system-link-list li {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(143,167,182,.35);
  background: #0b141d;
  padding: 8px;
}
.system-link-list button,
.track-list button {
  border: 1px solid var(--b-border);
  background: #172633;
  color: #d8edf6;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font-family: "Courier New", monospace;
}
.system-link-list span {
  color: #8fa7b6;
}
.leak-table {
  font-size: 13px;
}
.leak-table th {
  width: auto;
}
.ledger-page {
  position: relative;
}
.ledger-table s {
  color: #8299a8;
}
.margin-note {
  margin: 16px 0;
  border-left: 3px solid var(--b-warn);
  padding: 10px 12px;
  color: #f1d1d1;
  background: rgba(255,91,91,.08);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Gulim, sans-serif;
  line-height: 1.75;
}
.broadcast-player {
  margin: 16px 0;
  border: 1px solid rgba(143,167,182,.35);
  background: #0b141d;
  padding: 14px;
}
.broadcast-progress {
  height: 10px;
  border: 1px solid var(--b-border);
  background: #050c12;
}
.broadcast-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--b-success);
  transition: width .3s ease;
}
.track-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.trace-list {
  margin: 16px 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.trace-list li {
  opacity: .35;
  border-left: 3px solid var(--b-border);
  padding: 6px 10px;
  background: #0b141d;
  color: #8fa7b6;
}
.trace-list li.is-visible {
  opacity: 1;
  color: #cfe1e8;
}

@media (max-width: 720px) {
  .archive-grid { grid-template-columns: 1fr; }
  .popup-stack { min-height: 190px; }
  .end-log { padding: 24px 28px; }
  .end-log h1 { font-size: 24px; }
  .system-link-list li,
  .track-list {
    grid-template-columns: 1fr;
  }
  .system-table {
    font-size: 13px;
  }
  .system-table th,
  .system-table td {
    display: block;
    width: 100%;
  }
  .console,
  .end-log,
  .system-address {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring { animation: none; }
}
