body.live-open { overflow: hidden; }

.live-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .18s ease;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.live-backdrop.open { opacity: 1; }
.live-shell {
  width: min(920px, 100%);
  height: 100dvh;
  background: radial-gradient(circle at 90% 0, var(--glow), transparent 28%), var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto auto auto minmax(0,1fr);
  overflow: hidden;
  transform: translateY(16px);
  transition: transform .18s ease;
  border-inline: 1px solid var(--line);
}
.live-backdrop.open .live-shell { transform: translateY(0); }
.live-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: max(22px, env(safe-area-inset-top)) 20px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  backdrop-filter: blur(18px);
}
.live-header h2 { margin: 0; font-size: clamp(28px,7vw,44px); line-height: .98; letter-spacing: -1.6px; }
.live-header p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.live-close {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}
.live-identity {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.live-identity strong { color: var(--ink); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #35d07f; box-shadow: 0 0 0 5px rgba(53,208,127,.11); }
.live-status { margin-left: auto; text-align: right; }
.live-status[data-tone="ok"] { color: #67dc9b; }
.live-status[data-tone="error"] { color: #ff9f8e; }

.live-room-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 20px 12px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
  background: rgba(255,255,255,.01);
}
.live-room-list::-webkit-scrollbar { display: none; }
.live-room {
  flex: 0 0 auto;
  min-width: 124px;
  max-width: 210px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
}
.live-room span { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 8px; font-weight: 900; }
.live-room strong { display: block; margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.live-room em { display: block; margin-top: 5px; color: #67dc9b; font-style: normal; font-size: 9px; font-weight: 850; }
.live-room.active { border-color: var(--accent); background: var(--accent-soft); }
.live-room.active span { color: var(--accent); }

.live-chat { min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto auto; }
.live-room-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.live-room-header .eyebrow { margin-bottom: 4px; }
.live-room-header h3 { margin: 0; font-size: 20px; letter-spacing: -.5px; }
.live-room-header > span { color: var(--muted); font-size: 9px; text-align: right; max-width: 46%; }
.live-log {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 28px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.live-empty { max-width: 460px; margin: 50px auto; text-align: center; border: 1px dashed var(--line); border-radius: 20px; padding: 26px; }
.live-empty strong { display: block; font-size: 18px; }
.live-empty p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.live-message { max-width: 720px; margin: 0 auto 13px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 16px 16px 16px 5px; background: var(--surface); }
.live-message.own { border-color: rgba(232,120,77,.42); background: var(--accent-soft); border-radius: 16px 16px 5px 16px; }
.live-message-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.live-message-head strong { font-size: 11px; color: var(--accent); }
.live-message-head span { font-size: 9px; color: var(--muted); }
.live-message p { margin: 7px 0 0; line-height: 1.45; font-size: 14px; word-break: break-word; }
.live-message-actions { display: flex; gap: 10px; margin-top: 10px; }
.live-message-actions button { border: 0; background: transparent; color: var(--muted); padding: 0; font-size: 9px; text-decoration: underline; }
.live-message-actions button:hover { color: var(--ink); }
.live-composer {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 9px;
  padding: 11px 20px;
  border-top: 1px solid var(--line);
  background: var(--topbar);
}
.live-composer textarea {
  resize: none;
  min-height: 46px;
  max-height: 110px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
  line-height: 1.35;
  font-size: 15px;
}
.live-composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.live-composer button {
  align-self: end;
  height: 46px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 16px;
  font-size: 12px;
  font-weight: 950;
}
.live-composer button:disabled { opacity: .55; cursor: wait; }
.live-rules { margin: 0; padding: 0 20px max(12px,env(safe-area-inset-bottom)); color: var(--muted); background: var(--topbar); font-size: 9px; line-height: 1.4; }

.nav-item[data-nav="live"] > span { color: #67dc9b; }

@media (min-width:760px) {
  .live-backdrop { align-items: center; padding: 22px; }
  .live-shell { height: min(860px, calc(100dvh - 44px)); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 30px 90px rgba(0,0,0,.46); }
  .live-header { padding-top: 22px; }
}
