:root{
  --bg:#0B0E13;
  --panel:#111722;
  --panel-2:#0E131B;
  --text:#DCE3EA;
  --muted:#7C8A9A;
  --patient:#E8A33D;
  --provider:#3FC6D6;
  --untrusted:#E85D5D;
  --line:#1E2733;
  --mono:'IBM Plex Mono',monospace;
  --sans:'IBM Plex Sans',sans-serif;
}
*{box-sizing:border-box;}
[hidden]{display:none !important;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--sans);
}

.topbar{
  padding:28px 32px 18px;
  border-bottom:1px solid var(--line);
}
.eyebrow{
  font-family:var(--mono);
  font-size:11px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
}
h1{
  font-size:20px;
  font-weight:600;
  margin:6px 0 20px;
  max-width:820px;
  line-height:1.35;
}

.boundary-strip{
  position:relative;
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  border:1px solid var(--line);
  border-radius:6px;
  overflow:hidden;
  font-family:var(--mono);
  font-size:12px;
}
.zone{
  padding:10px 14px;
  text-align:center;
  background:var(--panel-2);
  border-right:1px solid var(--line);
}
.zone:last-child{border-right:none;}
.patient-zone{color:var(--patient);}
.untrusted-zone{color:var(--untrusted);}
.provider-zone{color:var(--provider);}
.lock{margin-left:6px;}
.packet{
  position:absolute;
  top:50%;
  left:16px;
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--muted);
  transform:translateY(-50%);
  transition:left .6s ease, background .3s ease;
  box-shadow:0 0 8px currentColor;
}

.grid{
  display:grid;
  grid-template-columns:1fr 0.85fr 1fr;
  gap:1px;
  background:var(--line);
}
.col{
  background:var(--bg);
  padding:20px 22px;
  min-height:70vh;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.col-head{display:flex; align-items:baseline; justify-content:space-between; gap:10px;}
.col-head h2{margin:0; font-size:16px;}
.col-head small{color:var(--muted); font-weight:400;}
.did{font-family:var(--mono); font-size:11px; color:var(--muted); word-break:break-all;}

.patient .col-head h2{color:var(--patient);}
.provider .col-head h2{color:var(--provider);}
.relay .col-head h2{color:var(--untrusted);}

.steps{display:flex; flex-direction:column; gap:6px;}
.step{
  font-family:var(--mono);
  font-size:12px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:4px;
  color:var(--muted);
  transition:all .25s ease;
}
.step.active{
  color:var(--text);
  border-color:var(--patient);
}
.provider .step.active{border-color:var(--provider);}
.step.done{
  color:var(--bg);
  background:var(--patient);
  border-color:var(--patient);
}
.provider .step.done{background:var(--provider); border-color:var(--provider);}

.panel-body{display:flex; flex-direction:column; gap:12px; flex:1;}

button{
  font-family:var(--mono);
  background:transparent;
  border:1px solid var(--patient);
  color:var(--patient);
  padding:10px 14px;
  border-radius:4px;
  cursor:pointer;
  font-size:12.5px;
  transition:background .2s ease, color .2s ease;
}
.provider button{border-color:var(--provider); color:var(--provider);}
button:hover{background:var(--patient); color:var(--bg);}
.provider button:hover{background:var(--provider); color:var(--bg);}
button:disabled{opacity:.35; cursor:not-allowed;}

.field-group{display:flex; flex-direction:column; gap:8px;}
label{font-size:11px; color:var(--muted); font-family:var(--mono);}
input, select{
  background:var(--panel);
  border:1px solid var(--line);
  color:var(--text);
  padding:8px 10px;
  border-radius:4px;
  font-family:var(--mono);
  font-size:12.5px;
}

.pending{
  background:var(--panel);
  border:1px solid var(--untrusted);
  border-radius:6px;
  padding:14px;
  display:flex; flex-direction:column; gap:10px;
}
.pending pre{
  font-family:var(--mono);
  font-size:10.5px;
  color:var(--muted);
  white-space:pre-wrap;
  word-break:break-all;
  max-height:140px;
  overflow:auto;
  margin:0;
}
.verify-checks{display:flex; flex-direction:column; gap:4px; font-family:var(--mono); font-size:11.5px;}
.check-pass{color:#5FD68A;}
.check-fail{color:var(--untrusted);}

.chat{display:flex; flex-direction:column; gap:10px; flex:1;}
.chat-log{
  flex:1;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:6px;
  padding:12px;
  overflow-y:auto;
  font-family:var(--mono);
  font-size:12px;
  min-height:160px;
  max-height:320px;
}
.chat-log .msg{margin-bottom:8px; line-height:1.5;}
.chat-log .msg .who{color:var(--muted); font-size:10.5px; display:block;}
.chat-input{display:flex; gap:8px;}
.chat-input input{flex:1;}

.call{display:flex; flex-direction:column; gap:10px;}
.video-row{display:flex; gap:10px;}
.video-row video{
  width:50%;
  aspect-ratio:4/3;
  background:#000;
  border-radius:6px;
  border:1px solid var(--line);
  object-fit:cover;
}
.call-note{font-size:11px; color:var(--muted); font-family:var(--mono); line-height:1.5; margin:0;}

.relay .relay-note{font-size:12px; color:var(--muted); line-height:1.5;}
.relay-log{background:var(--panel-2); border-color:var(--untrusted); flex:1; max-height:none;}
.relay-log .msg .who{color:var(--untrusted);}

footer{
  padding:18px 32px 30px;
  color:var(--muted);
  font-family:var(--mono);
  font-size:11px;
  text-align:center;
  border-top:1px solid var(--line);
  margin-top:8px;
}

@media (max-width: 980px){
  .grid{grid-template-columns:1fr;}
  .boundary-strip{grid-template-columns:1fr; }
  .zone{border-right:none; border-bottom:1px solid var(--line);}
}
