/* EB Voice — Modern Teknoloji Minimalizmi
   Koyu zemin, ince kenarlıklar, tek vurgu rengi (sadece aktif durumlar için). */

:root {
    --bg: #0a0a0c;
    --surface: #111114;
    --surface-2: #17171b;
    --surface-3: #1e1e23;
    --border: #222228;
    --border-strong: #2f2f37;
    --text: #ededf0;
    --text-2: #a1a1ab;
    --text-3: #6b6b76;

    --accent: #c8f25a;
    --accent-ink: #0b0d05;
    --accent-soft: rgba(200, 242, 90, 0.12);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.1);

    --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

    --r-sm: 6px;
    --r: 10px;
    --r-lg: 14px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --t: 150ms var(--ease);

    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font: 400 14px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 16px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); font-feature-settings: 'zero' 1; }
.muted { color: var(--text-2); }
.icon { flex-shrink: 0; display: block; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
    display: grid; place-items: center;
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
}
.brand-name { font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--text);
    font: 500 14px var(--font);
    cursor: pointer;
    transition: background var(--t), border-color var(--t), transform var(--t), opacity var(--t);
}
.btn:hover { background: var(--surface-3); border-color: #3a3a44; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #d4f777; border-color: #d4f777; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: rgba(255, 107, 107, .35); }
.btn-block { width: 100%; }

.btn-icon {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: background var(--t), color var(--t), border-color var(--t);
}
.btn-icon:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.input-wrap { position: relative; display: block; }
.input-wrap > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input {
    width: 100%; height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--bg);
    color: var(--text);
    font: 400 14px var(--font);
    transition: border-color var(--t), box-shadow var(--t);
}
.input-wrap > .icon + .input { padding-left: 38px; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.alert { padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; border: 1px solid; }
.alert-error { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 107, .25); }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-head { display: grid; gap: 4px; }

/* ---------- Auth / centered pages ---------- */
.page-center {
    display: grid; place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(600px 300px at 50% -10%, rgba(200, 242, 90, .06), transparent 70%),
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .045) 1px, transparent 0) 0 0 / 22px 22px,
        var(--bg);
}
.auth { width: 100%; max-width: 380px; display: grid; gap: 20px; justify-items: center; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; }
.auth-card { width: 100%; padding: 28px; display: grid; gap: 18px; }
.auth-card .btn-block { margin-top: 4px; }
.auth-foot { font-size: 11px; color: var(--text-3); letter-spacing: .02em; }

.error-card { justify-items: start; }
.error-code { font-size: 12px; color: var(--accent); padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 99px; }

/* ---------- Panel shell ---------- */
.panel { display: grid; grid-template-columns: 240px 1fr; }

.sidebar {
    position: sticky; top: 0;
    height: 100vh;
    display: flex; flex-direction: column; gap: 28px;
    padding: 20px 14px;
    border-right: 1px solid var(--border);
    background: var(--surface);
}
.sidebar .brand { padding: 0 6px; }

.nav { display: grid; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    height: 36px; padding: 0 10px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    transition: background var(--t), color var(--t);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--surface-3); color: var(--text); }
.nav-item.is-active .icon { color: var(--accent); }

.sidebar-foot {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    display: grid; place-items: center;
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    font-size: 13px; font-weight: 500;
}
.me-text { display: grid; min-width: 0; }
.me-name, .me-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-name { font-size: 13px; font-weight: 500; }
.me-sub { font-size: 11px; color: var(--text-3); }

.main { min-width: 0; padding: 40px 48px; max-width: 1120px; width: 100%; display: grid; gap: 28px; align-content: start; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.stat { display: grid; gap: 10px; padding: 20px 22px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-value { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.stat-value.is-live { color: var(--accent); }

/* ---------- Empty state ---------- */
.empty {
    display: grid; justify-items: center; gap: 8px; text-align: center;
    padding: 56px 24px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
}
.empty-icon {
    display: grid; place-items: center;
    width: 44px; height: 44px; margin-bottom: 6px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
}
.empty .muted { max-width: 360px; }

[hidden] { display: none !important; }

/* ---------- Misc ---------- */
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn.is-copied, .btn-icon.is-copied { color: var(--accent); border-color: rgba(200, 242, 90, .35); }
.btn.is-busy { opacity: .7; pointer-events: none; }
.alert-ok { color: var(--accent); background: var(--accent-soft); border-color: rgba(200, 242, 90, .25); }
.note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); }
.note .icon { color: var(--accent); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.join-choices { display: grid; gap: 8px; }
.input-pin { letter-spacing: .5em; font-size: 18px; }
.input-code { letter-spacing: .12em; text-transform: lowercase; }
a.auth-foot:hover { color: var(--text-2); }

.pill {
    display: inline-flex; align-items: center;
    height: 18px; padding: 0 6px;
    border-radius: 99px;
    background: var(--accent-soft);
    color: var(--accent);
    font: 500 10px var(--mono);
    text-transform: lowercase;
    vertical-align: 1px;
}
.pill-muted { background: var(--surface-3); color: var(--text-2); }

.live, .status, .conn { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.live i, .status i, .conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.live.is-on, .status.is-live { color: var(--text); }
.live.is-on i, .status.is-live i, .conn.is-ready i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 2s infinite; }
.conn.is-bad i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }

/* ---------- Panel sections ---------- */
.section { display: grid; gap: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.link-sub:hover { color: var(--text); }
.back { display: inline-block; font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.back:hover { color: var(--text); }
.head-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { display: contents; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 4px 12px; margin-right: 16px;
    color: var(--text-2);
    border-bottom: 1px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-color: var(--accent); }
.tab-count { font-size: 11px; color: var(--text-3); padding: 1px 6px; border-radius: 99px; background: var(--surface-2); }

.pager { display: flex; gap: 4px; }
.pager a { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--text-2); border: 1px solid var(--border); }
.pager a.is-active { color: var(--text); border-color: var(--accent); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .015); }
.t-title { display: block; font-weight: 500; color: var(--text); }
a.t-title:hover { color: var(--accent); }
.t-sub { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.t-muted { color: var(--text-2); }
.t-right { text-align: right !important; }
.t-actions { text-align: right; }
.t-actions > * { margin-left: 4px; }
.t-actions form { display: inline; }
@media (max-width: 1180px) {
    .t-actions .btn-label { display: none; }
    .t-actions .btn-sm { width: 30px; padding: 0; }
}

/* ---------- Share card ---------- */
.share { display: grid; gap: 16px; justify-items: start; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.share.is-new { border-color: rgba(200, 242, 90, .4); box-shadow: 0 0 0 4px var(--accent-soft); }
.share-flag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent); }
.share-grid { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.share-item { display: grid; gap: 6px; min-width: 0; }
.share-value { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 6px 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg); min-width: 0; }
.share-link { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-pin { font-size: 22px; letter-spacing: .14em; padding-right: 8px; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stats-4 .stat-value { font-size: 22px; }

/* ---------- Flow (log timeline) ---------- */
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font: 500 12px var(--font); cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }

.flow { list-style: none; margin: 0; padding: 8px 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.flow-item { position: relative; display: grid; grid-template-columns: 76px 20px 1fr; align-items: start; padding: 7px 20px; font-size: 13px; }
.flow-item::before { content: ''; position: absolute; left: 105px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.flow-item:first-child::before { top: 50%; }
.flow-item:last-child::before { bottom: 50%; }
.flow-time { font-size: 11px; color: var(--text-3); padding-top: 2px; }
.flow-dot { position: relative; z-index: 1; width: 9px; height: 9px; margin: 5px 0 0 5px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--text-3); }
.flow-body { color: var(--text-2); min-width: 0; }
.flow-body strong { color: var(--text); font-weight: 500; }
.flow-join .flow-dot, .flow-mic_on .flow-dot { border-color: var(--accent); }
.flow-leave .flow-dot, .flow-timeout .flow-dot { border-color: var(--text-3); background: var(--text-3); }
.flow-timeout .flow-body { color: var(--danger); }
.flow-chat .flow-dot { border-color: var(--text); background: var(--text); }
.flow-meeting_created .flow-dot, .flow-meeting_ended .flow-dot { border-radius: 2px; border-color: var(--accent); background: var(--accent); }
.flow-msg { margin-top: 4px; padding: 8px 12px; border-radius: 4px 10px 10px 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); white-space: pre-wrap; word-break: break-word; max-width: 640px; }

/* ---------- Dialog ---------- */
.dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text); }
.dialog::backdrop { background: rgba(5, 5, 7, .7); backdrop-filter: blur(4px); }
.dialog[open] { animation: rise 180ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.dialog-body { display: grid; gap: 18px; padding: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; }
.switch-title { display: block; font-weight: 500; }
.switch-sub { display: block; font-size: 12px; margin-top: 2px; }
.switch { appearance: none; flex-shrink: 0; position: relative; width: 36px; height: 20px; margin: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); cursor: pointer; transition: background var(--t), border-color var(--t); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform var(--t), background var(--t); }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(16px); background: var(--accent-ink); }

/* ---------- Room ---------- */
body.in-room { display: block; padding: 0; background: var(--bg); }

.room {
    position: fixed; inset: 0;
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas: "bar chat" "notice chat" "unlock chat" "stage chat" "controls chat";
}
.room-bar { grid-area: bar; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.room-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.room-id-text { min-width: 0; }
.room-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-meta { display: flex; gap: 14px; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.room-notice { display: flex; align-items: center; gap: 8px; margin: 12px 20px 0; padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
#hidden-banner { grid-area: notice; }
.room-notice-action { grid-area: unlock; justify-content: space-between; color: var(--text); }

.stage { grid-area: stage; min-height: 0; overflow-y: auto; display: grid; place-items: center; padding: 24px; }
.tiles { width: 100%; max-width: 980px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tiles[data-count="1"] { max-width: 360px; grid-template-columns: 1fr; }
.tiles[data-count="2"] { max-width: 680px; grid-template-columns: repeat(2, 1fr); }
.tiles[data-count="0"]::after { content: 'Odada henüz görünür katılımcı yok'; grid-column: 1 / -1; text-align: center; color: var(--text-3); font-size: 13px; }

.tile {
    position: relative;
    aspect-ratio: 4 / 3;
    display: grid; place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    transition: border-color var(--t);
}
.tile-avatar {
    display: grid; place-items: center;
    width: 76px; height: 76px;
    border-radius: 50%;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    font-size: 24px; font-weight: 500; letter-spacing: -0.02em;
    transition: box-shadow 120ms var(--ease), opacity var(--t);
}
.tile-foot { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-mic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); flex-shrink: 0; }
.tile.is-muted .tile-mic { color: var(--text-3); background: var(--surface-2); }
.tile-state { position: absolute; top: 10px; left: 12px; font: 11px var(--mono); color: var(--text-3); display: none; }
.tile.is-connecting .tile-state { display: block; }
.tile.is-connecting .tile-avatar { opacity: .45; }
.tile.is-speaking { border-color: rgba(200, 242, 90, .45); }
.tile.is-speaking .tile-avatar { box-shadow: 0 0 0 3px var(--accent), 0 0 0 9px var(--accent-soft); }

.controls { grid-area: controls; display: flex; justify-content: center; gap: 10px; padding: 16px 20px 20px; border-top: 1px solid var(--border); }
.ctl {
    display: inline-flex; align-items: center; gap: 10px;
    height: 48px; padding: 0 20px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font: 500 14px var(--font);
    cursor: pointer;
    transition: background var(--t), border-color var(--t), color var(--t);
}
.ctl:hover { background: var(--surface-3); }
.ctl:disabled { opacity: .6; cursor: wait; }
.ctl-ico { display: grid; }
.ctl-mic.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ctl-leave { color: var(--danger); }
.ctl-leave:hover { background: var(--danger-soft); border-color: rgba(255, 107, 107, .35); }
.ctl-end { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 107, .3); }

/* Chat */
.chat { grid-area: chat; display: grid; grid-template-rows: auto 1fr auto; min-height: 0; border-left: 1px solid var(--border); background: var(--surface); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.chat-head h2 { font-size: 14px; }
.chat-close, .chat-toggle { display: none; font-size: 20px; line-height: 1; }
.chat-toggle { position: relative; }
.badge { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: 600 10px/16px var(--mono); text-align: center; }

.chat-list { list-style: none; margin: 0; padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg { display: grid; gap: 3px; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-name { font-size: 12px; font-weight: 500; }
.msg.is-me .msg-name { color: var(--accent); }
.msg-head time { font-size: 10px; color: var(--text-3); }
.msg-body { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.sys { font-size: 11px; color: var(--text-3); text-align: center; }

.chat-form { display: flex; align-items: flex-end; gap: 6px; margin: 12px; padding: 6px 6px 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--bg); transition: border-color var(--t); }
.chat-form:focus-within { border-color: var(--accent); }
.chat-input { flex: 1; resize: none; min-height: 22px; max-height: 120px; padding: 5px 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 13px/1.45 var(--font); }
.chat-input::placeholder { color: var(--text-3); }
.chat-send { color: var(--accent); }
.chat-form.is-readonly { opacity: .6; }
.chat-form.is-readonly .chat-send { display: none; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--border-strong); font-size: 13px; animation: rise 180ms var(--ease); }

@media (max-width: 900px) {
    .room { grid-template-columns: 1fr; grid-template-areas: "bar" "notice" "unlock" "stage" "controls"; }
    .chat {
        position: fixed; inset: 0 0 0 auto; z-index: 20;
        width: min(380px, 100vw);
        transform: translateX(100%);
        transition: transform 200ms var(--ease);
        box-shadow: -20px 0 60px rgba(0, 0, 0, .5);
    }
    body.chat-open .chat { transform: none; }
    .chat-close, .chat-toggle { display: grid; }
}

@media (max-width: 520px) {
    .tiles, .tiles[data-count="2"] { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .tiles[data-count="1"] { grid-template-columns: 1fr; }
    .tile-avatar { width: 56px; height: 56px; font-size: 18px; }
    .stage { padding: 12px; }
    .controls { gap: 8px; padding: 12px 12px 16px; }
    .ctl { height: 46px; padding: 0 16px; }
    .ctl-leave .ctl-label, .ctl-end .ctl-label { display: none; }
    .share-grid { grid-template-columns: 1fr; }
    .flow-item { grid-template-columns: 58px 20px 1fr; padding: 7px 12px; }
    .flow-item::before { left: 79px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .panel { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky; z-index: 10;
        height: auto;
        flex-direction: row; align-items: center; gap: 12px;
        padding: 10px 16px;
        border-right: 0; border-bottom: 1px solid var(--border);
    }
    .sidebar .brand-name, .me-text { display: none; }
    .nav { display: flex; gap: 4px; }
    .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
    .main { padding: 24px 16px; }
}

@media (max-width: 520px) {
    .nav-item span { display: none; }
    .stats { grid-template-columns: 1fr; }
    .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
