.wrap{
  height:100%;
  display:flex;
  align-items:stretch;
  justify-content:center;
  padding:18px;
}

.term{
  width:min(980px,100%);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 18px 70px rgba(0,0,0,.55);
  position:relative;
  transform:perspective(1200px) rotateX(.6deg) rotateY(-.4deg);
  background:
    radial-gradient(900px 600px at 25% 15%, rgba(255,176,0,.07), transparent 55%),
    radial-gradient(900px 650px at 70% 25%, rgba(255,138,0,.05), transparent 55%),
    linear-gradient(180deg,var(--bg),var(--bg2));
}

.header{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  background:linear-gradient(180deg, rgba(255,176,0,.08), rgba(255,176,0,.03));
  border-bottom:1px solid var(--line);
}

.dots{display:flex;gap:7px}

.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  border:1px solid var(--line);
  background:rgba(255,176,0,.08);
}

.title{
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--dim);
}

.status{
  font-size:12px;
  color:var(--dim);
}

.screen{
  padding:16px 14px 18px;
  height:calc(100% - 42px);
  overflow:auto;
}

.cursor{
  display:inline-block;
  width:9px;
  height:1.1em;
  background:rgba(255,176,0,.7);
  margin-left:6px;
  position:relative;
  top:0.15em;
  animation:blink 1s steps(1,end) infinite;
}

@keyframes blink{50%{opacity:0}}

/* ===== Boot overlay ===== */

#boot{
  position:fixed;
  inset:0;
  background:#000;
  color:var(--amber);
  z-index:9999;
  display:none;
  padding:0;
}

body.power-off #boot{
  display:block;
}

#boot .tl{
  position:absolute;
  top:5px;
  left:16px;
  font-size:14px;
  line-height:1.3;
  white-space:pre;
}

#boot .barWrap{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(720px,84vw);
}

#boot .barLabel{
  font-size:13px;
  color:var(--dim);
  margin-bottom:10px;
  letter-spacing:.06em;
}

#boot .barOuter{
  height:12px;
  border:1px solid rgba(255,176,0,.45);
  border-radius:2px;
  overflow:hidden;
}

#boot .barFill{
  height:100%;
  width:0%;
  background:rgba(255,176,0,.95);
}

#boot .below{
  margin-top:12px;
  font-size:13px;
  color:var(--dim);
  min-height:46px;
  white-space:pre-wrap;
}

#boot .err{
  color:var(--amber2);
}

@media (max-width:520px){
  .term{transform:none}
}

.protocol-narration{
  opacity:0;
  transform:translateX(20px);
  pointer-events:none;
  transition:
    opacity .35s ease,
    transform .35s ease;
}

.protocol-narration.active{
  opacity:1;
  transform:translateX(0);
  pointer-events:auto;
}

.protocol-visual{
      font-size: 18px;
    text-wrap: auto;
}

#protocolNarration{
    position: absolute;
    top: 45%;
    left: 90%;
    z-index: 9996;
    width: 300px;
    height: 400px;
    display: flex;
    flex-direction: column;
}


#protocolRoot{
  position:relative;
  width:100%;
  height:100%;
}


#protocolNarration .win-head{
  flex-shrink:0;
}

#protocolNarration .win-body{
  flex:1;
  overflow:auto;
}

.continue-prompt{
  margin-top:24px;
  font-size:14px;
  color:var(--dim);
  letter-spacing:.08em;
  animation:blink 1.2s steps(1,end) infinite;
}

.protocol-visual{
  display:flex;
  flex-direction:column;
  height:100%;
}

.protocol-image{
  height:250px;              /* adjustable */
  border-bottom:1px solid var(--line);
  background:#000;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.protocol-image img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

.protocol-text{
  flex:1;
  padding:18px 14px;
  overflow:auto;
  font-size:18px;
  line-height:1.5;
  max-width:90%;
}

.protocol-image img{
  opacity:0;
  animation:fadeIn .6s ease forwards;
}

@keyframes fadeIn{
  to{opacity:1}
}


.protocol-narration.alert {
  color: #ff3b3b;
  text-shadow: 0 0 6px rgba(255,0,0,.4);
}

.protocol-narration.alert .glitch {
  animation: glitch 0.15s steps(2) infinite;
}

/* base narration */
.narration-line {
  display: block;
  white-space: pre-wrap;
}

/* escalation */
.narration-red {
  color: #ff3b3b;
  text-shadow:
    0 0 2px rgba(255,0,0,.6),
    0 0 6px rgba(255,0,0,.4);
}

/* optional: slight instability */
.narration-red {
  animation: glitch-flicker 0.15s infinite alternate;
}

@keyframes glitch-flicker {
  from { opacity: 1; }
  to { opacity: 0.85; }
}

.narration-red.severe {
  letter-spacing: 0.08em;
  filter: blur(0.3px);
}
