/* statik-chat.css — P22.STATIK_CHAT (Wave 12.2 + 12.3 redesign).
 *
 * Two changes from prior:
 *   1. Trigger pill now matches .live-pill geometry exactly so the
 *      header is visually uniform (same height, padding, font size,
 *      letter-spacing, radius). Color treatment stays cyan to keep
 *      the affordance distinct.
 *   2. Backdrop centers a FULL-SCREEN panel instead of bottom-sheet.
 *      Operator wanted the chat to take the whole viewport, not a
 *      stuck-at-bottom drawer.
 */

.statik-chat-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 7px;
  border-radius: 999px;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.40);
  color: #00e5ff;
  font-variant: all-small-caps;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}
.statik-chat-trigger:hover {
  background: rgba(0, 229, 255, 0.20);
  border-color: rgba(0, 229, 255, 0.60);
  color: #fff;
}
.statik-chat-trigger.has-pending::after {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ff6080;
  box-shadow: 0 0 8px rgba(255, 96, 128, 0.7);
  margin-left: 4px;
}

/* ── Full-screen modal ─────────────────────────────── */

.statik-chat-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  z-index: 11000;
  display: none;
}
.statik-chat-backdrop.is-open { display: block; }

.statik-chat-panel {
  position: absolute;
  inset: 0;                          /* full viewport */
  width: 100vw;
  height: 100vh;
  height: 100dvh;                     /* iOS dynamic vh respects URL bar */
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(15, 18, 26, 0.99) 0%, rgba(8, 10, 14, 1) 100%);
  border: none;
  border-radius: 0;
  overflow: hidden;
  animation: statikChatFadeIn 0.18s ease-out;
}
@keyframes statikChatFadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to   { opacity: 1; transform: scale(1); }
}

.statik-chat-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top, 0)) 18px 12px 18px;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.10), rgba(0, 229, 255, 0.0));
  border-bottom: 1px solid rgba(0, 229, 255, 0.20);
  font-family: var(--font-mono, Monaco, 'Courier New', monospace);
  flex-shrink: 0;
}
.statik-chat-hdr-title {
  display: flex; align-items: center; gap: 10px;
  color: #00e5ff;
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
}
.statik-chat-hdr-clear {
  background: transparent; border: 1px solid rgba(255, 90, 100, 0.30);
  color: rgba(255, 90, 100, 0.70);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  cursor: pointer; padding: 3px 10px; border-radius: 6px;
  font-family: inherit; margin-left: auto; transition: all 0.15s;
}
.statik-chat-hdr-clear:hover {
  background: rgba(255, 90, 100, 0.12);
  color: #ff5a64; border-color: rgba(255, 90, 100, 0.60);
}
.statik-chat-hdr-close {
  background: transparent; border: none;
  color: rgba(0, 229, 255, 0.80);
  font-size: 1.6rem; cursor: pointer; padding: 0 8px;
  line-height: 1; transition: color 0.15s; margin-left: 8px;
}
.statik-chat-hdr-close:hover { color: #fff; }

.statik-chat-messages {
  flex: 1;                            /* fills between header + input */
  overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--font-mono, Monaco, 'Courier New', monospace);
  font-size: 0.78rem;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.statik-chat-messages::-webkit-scrollbar { width: 6px; }
.statik-chat-messages::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.28); border-radius: 3px; }

.statik-chat-bubble {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}
.statik-chat-bubble .meta {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  opacity: 0.55;
  margin-bottom: 3px;
}
.statik-chat-bubble.role-operator {
  align-self: flex-end;
  background: rgba(58, 255, 138, 0.10);
  border: 1px solid rgba(58, 255, 138, 0.25);
  color: #d3f5e0;
}
.statik-chat-bubble.role-operator .meta { color: #3aff8a; }
.statik-chat-bubble.role-statik {
  align-self: flex-start;
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.24);
  color: #d3eef5;
}
.statik-chat-bubble.role-statik .meta { color: #00e5ff; }
.statik-chat-bubble.role-system {
  align-self: center;
  max-width: 96%;
  background: rgba(255, 200, 68, 0.06);
  border: 1px dashed rgba(255, 200, 68, 0.28);
  color: #fce0a0;
  font-size: 0.70rem;
}
.statik-chat-bubble.role-system .meta { color: #fc4; }
.statik-chat-bubble.topic-approval {
  border-left: 3px solid #ff6080;
}
.statik-chat-bubble.topic-narration {
  font-style: italic;
  opacity: 0.85;
}

.statik-chat-input-wrap {
  display: flex; gap: 10px;
  padding: 12px 14px max(14px, env(safe-area-inset-bottom, 0)) 14px;
  border-top: 1px solid rgba(0, 229, 255, 0.20);
  background: rgba(8, 10, 14, 0.95);
  flex-shrink: 0;
}
.statik-chat-input {
  flex: 1;
  background: rgba(20, 24, 32, 0.95);
  border: 1px solid rgba(0, 229, 255, 0.20);
  border-radius: 12px;
  color: #d3eef5;
  font-family: var(--font-mono, Monaco, 'Courier New', monospace);
  font-size: 0.85rem;
  padding: 10px 14px;
  resize: none;
  min-height: 40px; max-height: 160px;
}
.statik-chat-input:focus { outline: none; border-color: rgba(0, 229, 255, 0.55); }
.statik-chat-send {
  background: rgba(0, 229, 255, 0.20);
  border: 1px solid rgba(0, 229, 255, 0.50);
  color: #00e5ff;
  border-radius: 12px;
  padding: 0 18px;
  font-family: var(--font-mono, Monaco, 'Courier New', monospace);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.statik-chat-send:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.36);
  color: #fff;
}
.statik-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.statik-chat-typing {
  align-self: flex-start;
  color: rgba(0, 229, 255, 0.65);
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 0.04em;
}
.statik-chat-typing::after {
  content: '...'; display: inline-block;
  animation: statikChatDots 1s steps(4, end) infinite;
}
@keyframes statikChatDots { 0% { content: '.'; } 33% { content: '..'; } 66% { content: '...'; } }
