:root {
  --bg: #0b0d12;
  --bg-2: #0f1219;
  --panel: #141823;
  --panel-2: #1a1f2e;
  --border: #232a3a;
  --text: #e7ebf3;
  --muted: #98a2b8;
  --muted-2: #6b7488;
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --accent: #22d3ee;
  --accent-2: #34d399;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: 'Space Grotesk', 'Inter', sans-serif; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.15rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
  padding: .12em .4em;
  border-radius: 6px;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.grad {
  background: linear-gradient(100deg, var(--brand-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .96rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn--sm { padding: .55rem .95rem; font-size: .88rem; }
.btn--primary {
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 12px 30px -12px rgba(124, 92, 246, .8);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(124, 92, 246, .9); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--brand); transform: translateY(-2px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 6px 18px -6px var(--brand);
  flex: none;
}
.brand__text span { color: var(--muted); font-weight: 500; }
.nav__links { display: flex; align-items: center; gap: 1.4rem; }
.nav__links a { color: var(--muted); font-size: .94rem; font-weight: 500; transition: color .15s; }
.nav__links a:hover { color: var(--text); }
.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 80px; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 70% 0%, rgba(124, 92, 246, 0.28), transparent 60%),
    radial-gradient(50% 40% at 15% 10%, rgba(34, 211, 238, 0.18), transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}
.hero__inner { position: relative; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .9rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: .82rem; color: var(--muted);
  margin-bottom: 1.6rem;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
.hero__title { font-size: clamp(2.1rem, 5.2vw, 3.7rem); font-weight: 800; letter-spacing: -0.02em; }
.hero__lead { color: var(--muted); max-width: 680px; margin: 1.2rem auto 0; font-size: 1.06rem; }
.hero__cta { display: flex; gap: .8rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.hero__badges { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 2.4rem; }
.chip {
  font-size: .85rem; padding: .45rem .85rem; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section--alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__head { text-align: center; max-width: 660px; margin: 0 auto 3rem; }
.section__head p { color: var(--muted); }
.kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 700;
  color: var(--accent); margin-bottom: .8rem; display: inline-block;
}

.grid { display: grid; gap: 1.2rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform .18s ease, border-color .18s ease, background .18s;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand); background: var(--panel-2); }
.card p { color: var(--muted); margin: 0; }
.card__icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 1rem;
}
.card__icon svg { width: 24px; height: 24px; }
.icon--blue { background: rgba(99, 102, 241, .15); color: #a5b4fc; }
.icon--violet { background: rgba(139, 92, 246, .15); color: #c4b5fd; }
.icon--cyan { background: rgba(34, 211, 238, .15); color: #67e8f9; }
.icon--amber { background: rgba(245, 158, 11, .15); color: #fcd34d; }
.icon--pink { background: rgba(236, 72, 153, .15); color: #f9a8d4; }
.icon--green { background: rgba(52, 211, 153, .15); color: #6ee7b7; }

.tile {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.3rem;
}
.tile h4 { margin-bottom: .35rem; }
.tile p { color: var(--muted); margin: 0; font-size: .94rem; }

/* ---------- Host panel ---------- */
.host { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.host__copy p { color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .7rem; }
.ticks li { position: relative; padding-left: 1.7rem; color: var(--text); }
.ticks li::before {
  content: ''; position: absolute; left: 0; top: .45em;
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 10px rgba(52, 211, 153, .6);
}
.win {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.win__bar { display: flex; gap: 7px; padding: 12px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.win__bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a4252; }
.win__bar i:first-child { background: #ef4444; }
.win__bar i:nth-child(2) { background: #f59e0b; }
.win__bar i:nth-child(3) { background: #22c55e; }
.win__body { padding: 1.2rem; display: grid; gap: .7rem; }
.msg { font-size: .92rem; padding: .65rem .85rem; border-radius: 10px; max-width: 90%; }
.msg b { display: block; font-size: .76rem; color: var(--muted-2); margin-bottom: .15rem; font-weight: 600; }
.msg--agent { background: rgba(99, 102, 241, .12); border: 1px solid rgba(99, 102, 241, .25); justify-self: start; }
.msg--user { background: var(--panel-2); border: 1px solid var(--border); justify-self: end; text-align: right; }
.msg--note { font-size: .72rem; color: var(--muted-2); justify-self: end; background: none; padding: 0; }

/* ---------- Bot Markdown ---------- */
.msg__text--md > :first-child { margin-top: 0; }
.msg__text--md > :last-child { margin-bottom: 0; }
.msg__text--md p { margin: .35em 0; }
.msg__text--md h1, .msg__text--md h2, .msg__text--md h3, .msg__text--md h4 { margin: .6em 0 .3em; line-height: 1.25; font-weight: 700; }
.msg__text--md h1 { font-size: 1.2rem; }
.msg__text--md h2 { font-size: 1.1rem; }
.msg__text--md h3 { font-size: 1rem; }
.msg__text--md h4 { font-size: .95rem; }
.msg__text--md ul, .msg__text--md ol { margin: .35em 0; padding-left: 1.3em; }
.msg__text--md li { margin: .15em 0; }
.msg__text--md a { color: var(--accent); text-decoration: underline; word-break: break-word; }
.msg__text--md strong { font-weight: 700; }
.msg__text--md blockquote { margin: .4em 0; padding: .2em .8em; border-left: 3px solid var(--border); color: var(--muted); }
.msg__text--md hr { border: none; border-top: 1px solid var(--border); margin: .6em 0; }
.msg__text--md pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: .6em .8em; overflow-x: auto; margin: .45em 0; text-align: left; }
.msg__text--md pre code { background: none; color: var(--text); padding: 0; font-size: .85em; }
.msg__text--md table { border-collapse: collapse; margin: .45em 0; display: block; overflow-x: auto; }
.msg__text--md th, .msg__text--md td { border: 1px solid var(--border); padding: .25em .55em; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; counter-reset: step; }
.steps li {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.6rem; position: relative;
}
.steps__num {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; font-weight: 700; font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; margin-bottom: 1rem;
}
.steps p { color: var(--muted); margin: 0; }

/* ---------- CTA ---------- */
.cta { padding: 90px 0; position: relative; overflow: hidden; }
.cta__inner { text-align: center; position: relative; }
.cta h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.cta p { color: var(--muted); margin: .6rem auto 2rem; }
.cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(50% 80% at 50% 120%, rgba(124, 92, 246, .25), transparent 70%);
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 2.4rem 0; }
.footer__inner { display: grid; gap: 1.2rem; }
.footer__brand { display: flex; gap: .8rem; align-items: center; }
.footer__brand p { color: var(--muted); margin: .2rem 0 0; font-size: .9rem; }
.footer__meta { display: flex; gap: .5rem; flex-wrap: wrap; color: var(--muted-2); font-size: .9rem; }
.footer__meta a:hover { color: var(--text); }
.footer__copy { color: var(--muted-2); font-size: .85rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .host { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav__links {
    position: fixed; inset: 56px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: .5rem 24px 1rem; transform: translateY(-130%);
    transition: transform .25s ease;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: .8rem 0; border-bottom: 1px solid var(--border); }
  .nav__links a:last-child { border-bottom: 0; margin-top: .4rem; }
  .nav__toggle { display: flex; }
  .nav__toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.active span:nth-child(2) { opacity: 0; }
  .nav__toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
@media (max-width: 560px) {
  .grid--3 { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 56px; }
  .section { padding: 60px 0; }
  .hero__badges .chip { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- App (auth, lobby, room) ---------- */
.auth { min-height: 62vh; display: grid; place-items: center; padding: 48px 0; }
.auth-card { max-width: 440px; width: 100%; }
.small { font-size: .86rem; }
.muted { color: var(--muted); }

.form { display: grid; gap: .85rem; margin-top: .4rem; }
.form label { display: grid; gap: .35rem; font-size: .88rem; color: var(--muted); font-weight: 500; }
.form input, .form select {
  padding: .7rem .8rem; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: .95rem; font-family: inherit;
}
.form input:focus { outline: none; border-color: var(--brand); }
fieldset.caps {
  border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem;
  display: flex; gap: 1.1rem; flex-wrap: wrap; background: var(--bg-2);
}
fieldset.caps legend { color: var(--muted); font-size: .82rem; padding: 0 .4rem; }
.chk { display: flex; gap: .4rem; align-items: center; color: var(--text); font-size: .9rem; }
.form-error { color: #fca5a5; font-size: .85rem; margin: 0; }
.form-error a { color: #fca5a5; text-decoration: underline; }

.app { padding-top: 36px; }
.appbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.appbar h1 { margin: 0; font-size: 1.6rem; }

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.room-list { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .5rem; }
.room-list a {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 9px;
}
.room-list a:hover { border-color: var(--brand); background: var(--panel-2); }

.room-public {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .65rem .8rem; margin: .4rem 0 .8rem;
  border: 1px solid var(--border); border-radius: 9px;
}
.room-public:hover { border-color: var(--brand); background: var(--panel-2); }

.notice {
  margin-top: 1rem; padding: .8rem 1rem; border: 1px dashed var(--border);
  border-radius: 10px; color: var(--muted); background: var(--bg-2); font-size: .9rem;
}

.share { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; margin-top: .4rem; }
.share img { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 8px; }
.share__meta { flex: 1; min-width: 200px; display: grid; gap: .6rem; }
.copy-input { width: 100%; padding: .6rem .7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-family: ui-monospace, monospace; font-size: .82rem; }
.share__btns { display: flex; gap: .5rem; }

.invite-list { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .35rem; }
.tag { font-size: .7rem; padding: .1rem .45rem; border-radius: 6px; background: rgba(99,102,241,.18); color: #c7d2fe; margin-left: .3rem; }
.tag--off { background: rgba(239,68,68,.16); color: #fca5a5; }

@media (max-width: 760px) {
  .grid--2 { grid-template-columns: 1fr; }
  .share { flex-direction: column; }
}

/* ---------- Admin ---------- */
.adminnav { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.adminnav a {
  padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--border);
  color: var(--muted); font-size: .88rem; font-weight: 500;
}
.adminnav a:hover { color: var(--text); border-color: var(--brand); }
.adminnav a.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

.grid--4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.stat__n { font-size: 1.7rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.stat__l { color: var(--muted); font-size: .85rem; }
.stat__sub { font-size: .76rem; margin-top: .3rem; }
.stat__sub .ok { color: var(--accent-2); }
.stat__sub .bad { color: #fca5a5; }

.searchbar { display: flex; gap: .5rem; margin: .8rem 0 1rem; max-width: 420px; }
.searchbar input { flex: 1; padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); }

.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.tbl th, .tbl td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; background: var(--panel-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--panel-2); }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.btn--xs { padding: .3rem .55rem; font-size: .78rem; }
.visually-hidden { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.tag--admin { background: rgba(52,211,153,.18); color: #6ee7b7; }

.feed { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.feed li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }

@media (max-width: 900px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Chat room ---------- */
.room-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.2rem; align-items: start; }
.chat-col { min-width: 0; }
.side-col { display: grid; gap: 1.2rem; }
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 440px; padding: 1rem; position: relative; }
.chat-card .drop-hint {
  display: none; position: absolute; inset: .6rem; z-index: 5; pointer-events: none;
  align-items: center; justify-content: center; text-align: center;
  border: 2px dashed var(--brand); border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, .12); color: var(--text); font-weight: 600;
}
.chat-card.drag-over .drop-hint { display: flex; }
.chat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; gap: .5rem; }
.chat-head__right { display: flex; align-items: center; gap: .5rem; }
.side-toggle { display: none; }
.chat-messages { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; -webkit-overflow-scrolling: touch; }
.msg { padding: .55rem .75rem; border-radius: 10px; max-width: 88%; word-wrap: break-word; overflow-wrap: anywhere; }
.msg--user { background: var(--panel-2); border: 1px solid var(--border); align-self: flex-end; text-align: right; }
.msg--agent { background: rgba(99, 102, 241, .12); border: 1px solid rgba(99, 102, 241, .28); align-self: flex-start; }
.msg__head { font-size: .74rem; color: var(--muted-2); margin-bottom: .15rem; }
.msg__text { font-size: .95rem; white-space: pre-wrap; }
.msg__thinking { font-size: .82rem; white-space: pre-wrap; font-style: italic; opacity: .75; border-left: 2px solid var(--border); padding-left: .5rem; margin: .15rem 0 .3rem; }
.msg__img { display: block; max-width: 260px; max-height: 200px; border-radius: 8px; margin-top: .3rem; border: 1px solid var(--border); }
.msg__file { display: inline-block; margin-top: .3rem; padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; }

.mention-box {
  position: absolute; z-index: 90; min-width: 200px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.mention-item { padding: .5rem .7rem; cursor: pointer; font-size: .9rem; }
.mention-item:hover { background: var(--panel); }
.typing { min-height: 1.1rem; padding: .2rem 0; }
.chat-input { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.chat-toolbar { display: flex; gap: .4rem; flex-wrap: wrap; }
.chat-row { display: flex; gap: .5rem; align-items: stretch; }
.chat-row input { flex: 1 1 auto; min-width: 0; padding: .65rem .8rem; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: 16px; font-family: inherit; }
.chat-row input:focus { outline: none; border-color: var(--brand); }
.chat-row .btn { padding: .55rem 1rem; font-size: .92rem; flex: none; align-self: stretch; }

.lang-pick { display: inline-flex; align-items: center; gap: .3rem; }
.lang-pick__icon { font-size: .9rem; }
.lang-pick select {
  padding: .3rem .4rem; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: .82rem; font-family: inherit;
  max-width: 9rem; cursor: pointer;
}
.lang-pick select:focus { outline: none; border-color: var(--brand); }
.chk--inline { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--muted); cursor: pointer; user-select: none; }
.chk--inline input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }

.translate-btn, .copy-btn, .ask-btn { background: none; border: 0; cursor: pointer; padding: 0 .15rem; font-size: .82rem; color: var(--muted-2); opacity: .75; line-height: 1; }
.translate-btn:hover, .copy-btn:hover, .ask-btn:hover { opacity: 1; color: var(--accent); }
.translate-btn.is-on { color: var(--accent); opacity: 1; }
.msg__text.is-translated { font-style: italic; }
.side-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .35rem; }
.form.compact { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.form.compact input, .form.compact select { flex: 1; padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: .9rem; }
.form.compact button { flex: none; }

.side-close { display: none; }
.side-backdrop { display: none; }

@media (max-width: 820px) {
  .room-layout { grid-template-columns: 1fr; }
  .appbar h1 { font-size: 1.3rem; }
  .appbar { gap: .6rem; margin-bottom: .8rem; }
  .chat-card { height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 320px; padding: .8rem; }
  .side-toggle { display: inline-flex; }
  .side-close { display: inline-flex; margin-bottom: .4rem; }
  .side-col {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(86vw, 340px);
    background: var(--bg-2);
    border-left: 1px solid var(--border);
    z-index: 80;
    transform: translateX(105%);
    transition: transform .25s ease;
    overflow-y: auto;
    padding: 1rem;
    box-shadow: var(--shadow);
    gap: 1rem;
  }
  .side-col.open { transform: translateX(0); }
  .side-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 75;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .side-backdrop.show { opacity: 1; pointer-events: auto; }
}
@media (max-width: 420px) {
  .chat-card { height: calc(100vh - 138px); height: calc(100dvh - 138px); padding: .65rem; }
  .chat-row input { font-size: 16px; }
  .msg { max-width: 92%; }
}

/* ---------- Media (voice/video) ---------- */
.media-panel { padding: 1rem; margin-bottom: 1.2rem; }
.media-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.media-controls { display: flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.media-tiles { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.media-tile-wrap { position: relative; width: 180px; aspect-ratio: 4 / 3; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.media-tile { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.media-tile-wrap .media-label, #localTile ~ .media-label { position: absolute; left: 6px; bottom: 6px; font-size: .72rem; color: #fff; background: rgba(0,0,0,.5); padding: .1rem .4rem; border-radius: 5px; }
#localTile { width: 180px; aspect-ratio: 4 / 3; background: #000; border-radius: 10px; border: 1px solid var(--border); object-fit: cover; }
