/* The conversation is a typographic stage, not a panel over the artwork. */
body.chat-open { overflow: hidden; }
.chat-open .site { pointer-events: none; }
#chat {
  position: fixed; inset: 0; margin: 0; padding: 0;
  width: 100%; max-width: none; height: 100dvh; max-height: none;
  border: 0; overflow: hidden; color: var(--paper);
  background: radial-gradient(ellipse at 50% 72%, #112c3055, transparent 65%), #060c13;
}
#chat::backdrop { background: #060c13; }
#transmission { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.channel-grid {
  position: absolute; left: -50%; bottom: -45%; width: 200%; height: 75%;
  background-image: linear-gradient(#66c5b417 1px, transparent 1px), linear-gradient(90deg, #66c5b417 1px, transparent 1px);
  background-size: 70px 70px; transform: perspective(450px) rotateX(60deg);
  mask-image: linear-gradient(transparent, black); pointer-events: none;
}
.transmission-stage {
  height: 100%; width: min(1100px, 88%); margin: 0 auto;
  display: flex; flex-direction: column; position: relative; z-index: 1;
  padding: 38px 0 25px;
}
.chat-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.chat-header .eyebrow { margin: 0 0 8px; color: var(--lime); font-size: 9px; }
.chat-header h2 { font-size: 18px; letter-spacing: -.5px; margin: 0; color: #b5c4c6; }
.channel-actions { display: flex; align-items: center; gap: 20px; }
.channel-actions button { background: transparent; color: #98aaa9; font: 10px var(--mono); padding: 7px 0; }
.channel-actions button:hover { color: var(--lime); }
.channel-actions .icon-button { font: 30px/1 Arial, sans-serif; width: 32px; padding: 0; margin: -2px 0 0 10px; }
.host-line { border: none; padding: 17px 0 0; color: #8fa6a5; font: 10px var(--mono); display: flex; gap: 8px; align-items: center; }
#connection { margin-left: auto; font-size: 9px; color: #8bafaa; }
#transcript {
  width: min(800px, 100%); margin: 0 auto; flex: 1; min-height: 60px;
  overflow-y: auto; overflow-x: hidden; padding: 60px 15px 30px;
  scrollbar-width: thin; scrollbar-color: #4e817333 transparent;
  overscroll-behavior: contain; scroll-behavior: auto;
  mask-image: linear-gradient(transparent, black 24px, black calc(100% - 12px), transparent);
}
.message {
  font: 400 clamp(19px, 2.2vw, 30px)/1.55 var(--mono);
  letter-spacing: -.8px; margin: 0 0 45px; padding: 0;
  max-width: none; white-space: pre-wrap; overflow-wrap: anywhere;
  transform-origin: center bottom; transform: none;
  transition: opacity .7s, transform .9s cubic-bezier(.16,1,.3,1);
}
.message .sender { display: block; font: 9px var(--mono); letter-spacing: 2px; margin-bottom: 18px; color: #77aca0; }
.message .body { color: #d9f4df; text-shadow: 0 0 22px #7fd9c22c; }
.message.visitor { background: none; padding: 0; margin: 0 0 45px; }
.message.visitor .sender { color: #a4ba86; }
.message.visitor .body { color: var(--lime); }
.message.system { font-size: 13px; line-height: 1.7; color: #9eb3b3; }
.message a { color: inherit; text-decoration: underline; text-underline-offset: 5px; }
.message:not(:last-child) { opacity: .42; transform: perspective(650px) rotateX(28deg) translateZ(-45px) scale(.94); }
#transcript.reading .message, .message:hover, .message:focus-within { opacity: 1; transform: none; }
.message.assembling { transform: none; opacity: 1; }
.message.assembling .body { opacity: var(--ink, 0); }
.transmit-dock { width: min(770px, 100%); margin: 0 auto; position: relative; z-index: 3; }
#typing { text-align: center; color: #a3d5c0; font: 10px var(--mono); min-height: 25px; margin: 0; }
#compose { display: flex; align-items: center; gap: 17px; background: transparent; border: none; border-bottom: 1px solid #7dba9866; padding: 11px 0; }
#compose:focus-within { border-color: var(--lime); box-shadow: 0 12px 24px -24px var(--lime); }
.input-prefix { color: var(--lime); font: 26px var(--mono); }
#message { width: 100%; min-height: 40px; max-height: 120px; resize: none; background: none; border: none; color: #eaffd1; font: 16px/1.6 var(--mono); padding: 7px 0; }
#message::placeholder { color: #657e7f; }
#message:focus-visible { outline: none; }
#send { background: none; color: var(--lime); width: auto; height: 40px; padding: 0; font: 23px var(--mono); white-space: nowrap; }
#send span { font-size: 10px; letter-spacing: 1px; padding-right: 10px; }
.input-hint { color: #78948f; font: 9px/1.6 var(--mono); margin: 11px 0 20px 34px; }
.input-hint kbd { font: inherit; color: #a7bbae; }
#recovery { margin-bottom: 10px; }
#error { font: 12px/1.5 var(--mono); color: #e1c692; margin: 0; }
#notice { font: 10px/1.5 var(--mono); color: #91a6a3; margin: 8px 0; }
#notice:empty { display: none; }
.chat-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font: 8px/1.5 var(--mono); color: #829c95; }
.chat-footer a { text-decoration: underline; text-underline-offset: 3px; }
.chat-footer button { font: 9px var(--mono); background: none; color: #aab9ae; padding: 0; }
#followup { margin-top: 12px; font-size: 12px; }
#followup>div { display: flex; gap: 8px; margin-top: 8px; }
#email { background: #16252b; border: 1px solid #66827480; color: var(--paper); padding: 10px; min-width: 0; flex: 1; }
#followup button { background: var(--lime); color: #172316; padding: 10px; }
@media (max-width:600px) {
  .transmission-stage { width: 88%; padding: 24px 0 max(20px, env(safe-area-inset-bottom)); }
  .chat-header h2 { font-size: 15px; }
  .channel-actions { gap: 10px; }
  .channel-actions button { font-size: 8px; }
  #replay { font-size: 0; }
  #replay::after { content: '↻'; font-size: 24px; }
  .channel-actions .icon-button { margin-left: 0; }
  .host-line { font-size: 8px; }
  #connection { font-size: 8px; }
  #transcript { padding: 32px 2px 16px; }
  .message { font-size: 19px; line-height: 1.6; letter-spacing: -.55px; margin-bottom: 30px; }
  .message.visitor { margin-bottom: 30px; }
  .message .sender { font-size: 8px; margin-bottom: 13px; }
  #message { font-size: 16px; }
  #send span { display: none; }
  #compose { gap: 10px; }
  .input-hint { font-size: 8px; margin-left: 0; }
  .escape-hint { display: none; }
}
@media (max-height:600px) {
  .transmission-stage { padding-top: 15px; padding-bottom: 12px; }
  .channel-caption, .chat-header h2, .input-hint { display: none; }
  .host-line { padding-top: 6px; }
  #transcript { padding-top: 22px; }
  .message { font-size: 18px; margin-bottom: 20px; }
}
@media (prefers-reduced-motion:reduce) {
  .message:not(:last-child) { transform: none; opacity: 1; }
}
/* Keep only the conversation and its essential controls. */
.chat-header h2 { font:700 24px Arial, sans-serif; color:var(--paper); letter-spacing:-1px; }
.channel-actions { gap:14px; }
.channel-actions button, .channel-actions .icon-button { width:44px; height:44px; font:24px/1 var(--mono); margin:0; padding:0; }
#replay::after { content:none; }
#transcript { padding-top:80px; }
.input-hint { margin-bottom:12px; }
@media(max-width:600px) { .chat-header h2{font-size:22px}.channel-actions{gap:2px}.channel-actions button,#replay{font-size:22px}#transcript{padding-top:40px} }
@media(max-height:600px) { #transcript{padding-top:25px}.chat-header h2{display:block} }
