/* 1.17.4.0: UNIT-7 LIVE, the dev account the GM speaks through as UNIT-7.
   Picked on the "UNIT-7 Chat Identity" board: green readout under a violet
   CONTROLLED tag (PID:7 mirrors the owner's UID:0: root is the brain, UNIT-7 a
   process that runs under it), REC header, struck runs in the old red-eye red,
   SUBJECT boxes for names, a dashed control ring crawling round the portrait.
   The guide bot (AUTO, .cm-guide) is untouched and must stay distinguishable. */
.chat-msg.cm-u7 { margin: 6px -8px !important; padding: 6px 8px 7px;
  background: linear-gradient(90deg, rgba(181,126,220,.09), rgba(181,126,220,0) 70%); }
.cm-u7 .chat-avatar-w { border-color: transparent !important; background: #050505; overflow: visible; }
.cm-u7 .chat-avatar-w > img { border-radius: 50%; }
.cm-u7 .chat-avatar-w::after { content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px dashed #b57edc; animation: u7Ring 9s linear infinite; pointer-events: none; }
.cm-u7 .chat-avatar-w::before { content: ''; position: absolute; right: -1px; bottom: 1px; z-index: 1;
  width: 7px; height: 7px; border-radius: 50%; background: #e6c4ff; box-shadow: 0 0 6px #b57edc;
  animation: u7Led 3.6s steps(1,end) infinite; }
@keyframes u7Ring { to { transform: rotate(360deg); } }
@keyframes u7Led { 0%,80% { opacity: 1 } 85% { opacity: .2 } 90%,100% { opacity: 1 } }

.cm-u7 .chat-username { color: #7cf0a4 !important; font-weight: 400; text-decoration: none !important;
  font-family: 'Share Tech Mono', ui-monospace, monospace; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.u7-hex { width: 14px; height: 14px; color: #7cf0a4; flex: 0 0 auto; }
.u7-name { color: #040806; background: #7cf0a4; padding: 0 5px; letter-spacing: .08em; }
.role-tag.u7-tag { display: inline-flex; align-items: stretch; border: 1px solid #b57edc; font-size: .7em;
  letter-spacing: .08em; line-height: 1.35; padding: 0; margin: 0; font-weight: 400; }
.u7-tag .p { padding: 0 5px; background: #150a1e; color: #a98bc6; }
.u7-tag .c { padding: 0 6px; background: #b57edc; color: #12051c; }

/* Header and body sit under the name, indented past the portrait. */
.u7-rec, .cm-u7 .u7-text { display: block; padding-left: calc(var(--fm-avatar, 52px) * var(--chat-font-scale, 1) + 9px); }
.cm-u7 .u7-rec { margin-top: 2px; font-family: 'Share Tech Mono', ui-monospace, monospace; font-size: .72em; letter-spacing: .12em; color: #a98bc6; }
.cm-u7 .u7-text { font-family: 'Share Tech Mono', ui-monospace, monospace; color: #b9f7cf; text-shadow: 0 0 5px rgba(124,240,164,.18); }
.u7-strike { color: #ff4a2a; text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: #ff4a2a; }
.u7-subj { color: #e6c4ff; border: 1px solid #b57edc; padding: 0 4px; }
.cm-u7 .chat-mention, .cm-u7 .u7-subj { background: none; }

/* A live line types out once, then the block cursor blinks four times and stops. */
.u7-type { display: inline-block; max-width: 100%; animation: u7Type var(--u7-dur, 1.6s) steps(var(--u7-steps, 40), end) 1 both; }
@keyframes u7Type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.u7-cur { display: inline-block; width: .55em; height: 1em; margin-left: 2px; vertical-align: -2px; background: #7cf0a4;
  animation: u7Cur .8s steps(1,end) 4 both; animation-delay: var(--u7-dur, 1.6s); opacity: 0; }
@keyframes u7Cur { 0%,49% { opacity: 1 } 50%,100% { opacity: 0 } }

@keyframes u7Notice { 0% { opacity: 0; letter-spacing: .4em } 12% { opacity: 1; letter-spacing: .18em } 100% { opacity: 1; letter-spacing: .18em } }
.u7-notice { margin: 6px 0 2px; padding: 3px 0; text-align: center; font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .18em; color: #c79ae8; border-top: 1px solid #2a1838; border-bottom: 1px solid #2a1838;
  animation: u7Notice 1.6s ease-out 1 both; }

/* ── Composer (UNIT-7 account only): the STRIKE key and the mirror line ─────
   The input keeps the real text, markers included, and is drawn transparent; a
   mirror behind it paints the same characters with the struck runs in red. The
   markers are zero-width, so the caret lands where the mirror says it does. */
#u7StrikeBtn { flex: 0 0 auto; min-width: 64px; background: #0b0710; border: 1px solid #3a2a4a; color: #8a72a3;
  border-radius: 4px; font-family: 'Share Tech Mono', ui-monospace, monospace; font-size: .7rem; letter-spacing: .12em; cursor: pointer; padding: 0 8px; }
#u7StrikeBtn s { text-decoration-thickness: 1px; }
#u7StrikeBtn[aria-pressed="true"] { background: #ff4a2a; border-color: #ff4a2a; color: #1a0402; box-shadow: 0 0 10px rgba(255,74,42,.55); }
#chatInputRow.u7-striking { box-shadow: inset 0 0 0 1px #4a0a10, inset 0 0 18px rgba(255,74,42,.08); }
#chatInputRow.u7-striking #chatInput { border-color: #4a0a10; caret-color: #ff4a2a; }
.u7-inwrap { position: relative; flex: 1; display: flex; min-width: 0; }
.u7-inwrap > #chatInput { flex: 1; color: transparent !important; caret-color: #7cf0a4; position: relative; z-index: 1; background: transparent !important; }
.u7-mirror { position: absolute; inset: 0; overflow: hidden; white-space: pre; pointer-events: none; box-sizing: border-box; color: #b9f7cf; }
.u7-mirror > span { display: inline-block; }
.u7-inbg { position: absolute; inset: 0; border-radius: 5px; background: var(--input-bg, #020403); }

@media (prefers-reduced-motion: reduce) {
  .cm-u7 .chat-avatar-w::after, .cm-u7 .chat-avatar-w::before, .u7-type, .u7-notice { animation: none; }
  .u7-cur { display: none; }
}

/* ── Profile (UNIT-7 account): the station's back rooms ─────────────────────── */
#playerProfilePopup.fm-u7-pp { isolation: isolate; }
#playerProfilePopup.fm-u7-pp > :first-child:not(.fm-u7-pplayer) { background: transparent !important; }
.fm-u7-pplayer { position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; overflow: hidden;
  background: url("unit7-backroom.svg") center top / cover no-repeat, #030404; }
.fm-u7-pplayer::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(3,4,4,0) 0 150px, rgba(3,4,4,.74) 230px, rgba(3,4,4,.7)); }
.fm-u7-pphead { font-family: 'Share Tech Mono', ui-monospace, monospace; font-size: .62rem; letter-spacing: .16em; color: #a98bc6; margin: 2px 0 4px; }
#ppName.fm-plate-u7 { display: inline-block; padding: 3px 12px; background: #7cf0a4; color: #040806 !important; letter-spacing: .1em;
  font-family: 'Share Tech Mono', ui-monospace, monospace; font-weight: 400; text-shadow: none; box-shadow: none; }
#ppPortrait.fm-u7-face { border-radius: 50% !important; border-color: #b57edc !important; box-shadow: 0 0 0 2px #b57edc, 0 0 24px rgba(181,126,220,.3); }
