/* Inter — сервира се от нашия домейн, без външни заявки */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-cyrillic-400.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-cyrillic-500.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-cyrillic-600.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-cyrillic-700.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/inter-cyrillic-800.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/inter-latin-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ===== Токени (Teams-подобна палитра) ===== */
:root {
    --brand: #5b5fc7;
    --brand-hover: #4f52b2;
    --brand-press: #444791;
    --brand-light: #7b83eb;
    --brand-tint: #e8ebfa;
    --bg: #f5f5f5;
    --surface: #ffffff;
    --border: #e1e1e1;
    --border-strong: #d1d1d1;
    --text: #242424;
    --text-2: #424242;
    --muted: #616161;
    --danger: #c4314b;
    --danger-hover: #a4262c;
    --stage: #1f1f1f;
    --tile: #292929;
    --ctl: #2d2d2d;
    --ctl-hover: #3d3d3d;
    --speak: #7f85f5;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(36, 36, 72, 0.12);
    --shadow-lg: 0 24px 60px rgba(36, 36, 72, 0.22);
    --rail: linear-gradient(180deg, #4a4d9e 0%, #33356e 100%);
    --hero: linear-gradient(135deg, #2f3166 0%, #4f52b2 38%, #6d5fd6 66%, #b43cb0 100%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
    margin: 0;
    font-family: "Inter", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.015em; margin: 0; }
a { color: var(--brand); text-decoration: none; }
p { margin: 0; }

/* ===== Общи елементи ===== */
.brand-mark {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-light), var(--brand-hover));
    color: #fff; font-weight: 800; font-size: 13px; letter-spacing: 0.3px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(79, 82, 178, 0.4);
    flex-shrink: 0;
}
.brand-mark.small { width: 32px; height: 32px; font-size: 11px; border-radius: 8px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 8px; border: 1px solid transparent;
    font: 600 14px/1.2 inherit; font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-primary:disabled { background: #bdbdbd; cursor: default; }
.btn-light { background: #fff; color: var(--brand-press); box-shadow: var(--shadow-sm); }
.btn-light:hover { background: var(--brand-tint); color: var(--brand-press); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-svg { width: 18px; height: 18px; }

.field-label {
    display: block; text-align: left;
    font-size: 12.5px; font-weight: 600; color: var(--text-2);
    margin: 16px 0 6px;
}
.field {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit; color: var(--text);
    transition: border-color 0.15s;
}
.field:focus { outline: none; border-bottom-color: var(--brand); }
.form-error {
    background: #fdf3f4; color: var(--danger-hover);
    border: 1px solid #f1bbbc; border-radius: 8px;
    padding: 10px 12px; font-size: 13px; margin-top: 14px; text-align: left;
}

/* ===== Работно пространство: лента + горна лента ===== */
.shell { display: flex; height: 100vh; }

.rail {
    width: 78px; flex-shrink: 0;
    background: var(--rail);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 0;
}
.rail-brand { margin-bottom: 10px; }
.rail-item {
    position: relative;
    width: 66px; padding: 9px 0 7px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10.5px; font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.rail-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.rail-item.active { background: rgba(255, 255, 255, 0.18); color: #fff; }
.rail-item.active::before {
    content: ""; position: absolute; left: -6px; top: 10px; bottom: 10px;
    width: 3px; border-radius: 3px; background: #fff;
}
.rail-svg { width: 22px; height: 22px; }
.rail-spacer { flex: 1; }

.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar {
    height: 56px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.topbar-app { color: var(--brand); font-weight: 800; }
.topbar-sep { color: #bdbdbd; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.me-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px;
}
.room-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand-tint); color: var(--brand-press);
    border-radius: 999px; padding: 5px 12px;
    font-size: 12.5px; font-weight: 600;
}
.pill-svg { width: 15px; height: 15px; }

.page { flex: 1; min-height: 0; overflow: auto; padding: 28px 32px; display: flex; flex-direction: column; }

/* ===== Начало ===== */
.welcome {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    background: var(--hero);
    color: #fff;
    border-radius: 16px;
    padding: 30px 34px;
    box-shadow: var(--shadow-md);
}
.welcome h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.welcome p { opacity: 0.9; }
.section-title { font-size: 16px; font-weight: 700; margin: 30px 0 14px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.action-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 22px 20px;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.action-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.action-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--c) 14%, #fff);
    color: var(--c);
    margin-bottom: 6px;
}
.action-icon.large { width: 60px; height: 60px; border-radius: 14px; margin: 0; }
.action-svg { width: 24px; height: 24px; }
.action-icon.large .action-svg { width: 30px; height: 30px; }
.action-title { font-size: 16px; font-weight: 700; }
.action-desc { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.action-go { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--c); font-weight: 600; font-size: 13px; }
.go-svg { width: 15px; height: 15px; }

.section-hero {
    display: flex; align-items: center; gap: 18px;
    background: var(--surface); border: 1px solid var(--border);
    border-left: 6px solid var(--c);
    border-radius: 16px; padding: 24px;
    box-shadow: var(--shadow-sm);
}
.section-hero h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.section-hero p { color: var(--muted); }
.empty-card {
    margin-top: 18px;
    background: var(--surface); border: 1px dashed var(--border-strong);
    border-radius: 16px; padding: 48px 24px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-title { font-size: 17px; font-weight: 700; }
.empty-text { color: var(--muted); margin-bottom: 14px; }

/* ===== Видеоразговор: преди влизане ===== */
.prejoin { flex: 1; display: flex; align-items: center; justify-content: center; }
.prejoin-card {
    width: 100%; max-width: 440px;
    background: var(--surface);
    border-radius: 18px;
    padding: 36px 36px 30px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.prejoin-avatar {
    width: 92px; height: 92px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 34px; font-weight: 800;
    margin-bottom: 16px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}
.prejoin-card h1 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.prejoin-sub { color: var(--muted); margin-bottom: 6px; }
.prejoin-card .btn-block { margin-top: 20px; }
.prejoin-facts { list-style: none; padding: 0; margin: 22px 0 0; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.prejoin-facts li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.fact-svg { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; }

/* ===== Видеоразговор: сцена ===== */
.meeting { flex: 1; min-height: 0; display: flex; gap: 16px; margin: -12px -16px -16px; }
.stage {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    background: var(--stage);
    border-radius: 16px;
    padding: 14px 16px 12px;
    color: #fff;
}
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 4px 12px; font-size: 13px; }
.stage-status { color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.stage-quality { color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }

.call-grid {
    flex: 1; min-height: 0; overflow: auto;
    display: grid; gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
}
.call-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); max-width: 1100px; width: 100%; margin: 0 auto; }
.call-grid[data-count="5"], .call-grid[data-count="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.call-tile {
    position: relative; overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--tile);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.call-tile.speaking { border-color: var(--speak); box-shadow: 0 0 0 3px rgba(127, 133, 245, 0.28); }
.call-tile video, .call-tile canvas { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.call-tile video.mirror { transform: scaleX(-1); }
.call-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--tile); }
.tile-avatar {
    width: 84px; height: 84px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 28px; font-weight: 800;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.call-label {
    position: absolute; left: 10px; bottom: 10px;
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    padding: 4px 10px; border-radius: 6px;
    font-size: 12.5px; font-weight: 600;
}
.call-muted { background: var(--danger); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 600; }

.call-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.ctl {
    position: relative;
    display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
    min-width: 74px; padding: 9px 12px 7px;
    background: var(--ctl); color: #fff;
    border: none; border-radius: 10px;
    font: 600 11.5px/1 inherit; font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.ctl:hover { background: var(--ctl-hover); }
.ctl-svg { width: 20px; height: 20px; }
.ctl .i-on, .ctl .i-off { display: inline-flex; }
.ctl .i-off { display: none; }
.ctl.off .i-on { display: none; }
.ctl.off .i-off { display: inline-flex; }
.ctl.off { color: #ff99a4; }
.ctl.on { background: var(--brand); }
.ctl.on:hover { background: var(--brand-hover); }
.ctl-danger { background: var(--danger); }
.ctl-danger:hover { background: var(--danger-hover); }
.ctl-badge {
    position: absolute; top: 4px; right: 12px;
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: var(--danger); color: #fff;
    font-size: 10px; line-height: 17px; text-align: center;
}

/* ===== Чат ===== */
.chat {
    width: 330px; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.chat.closed { display: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 15px 16px; border-bottom: 1px solid var(--border); font-weight: 700; }
.chat-head .pill-svg { color: var(--brand); }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { margin: auto; color: var(--muted); font-size: 13px; }
.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .chat-avatar { display: none; }
.chat-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10.5px; font-weight: 700;
}
.chat-body { max-width: 82%; background: var(--bg); border-radius: 10px; padding: 7px 11px 9px; }
.chat-msg.mine .chat-body { background: var(--brand-tint); }
.chat-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.chat-text { font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.chat-text a { color: var(--brand-press); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.chat-text a:hover { color: var(--brand); }

.link-card {
    display: block; margin-top: 8px;
    width: 260px; max-width: 100%;
    background: #fff; color: var(--text);
    border: 1px solid var(--border); border-left: 3px solid var(--brand);
    border-radius: 8px; overflow: hidden;
    transition: box-shadow 0.15s;
}
.link-card:hover { box-shadow: var(--shadow-md); color: var(--text); }
.link-img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: var(--bg); }
.link-text { padding: 8px 10px 10px; }
.link-site { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.link-title { font-size: 13.5px; font-weight: 700; line-height: 1.3; margin-top: 3px; }
.link-desc {
    font-size: 12.5px; color: var(--text-2); line-height: 1.4; margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Реакции — една хоризонтална лента, бутоните един до друг, без пренасяне */
.chat-body { position: relative; min-width: 170px; }
.chat-react {
    display: inline-flex; flex-wrap: nowrap; align-items: stretch;
    margin-top: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0.7;
    transition: opacity 0.15s, box-shadow 0.15s;
}
.chat-msg:hover .chat-react, .chat-react:has(.has) { opacity: 1; }
.chat-react:hover { box-shadow: var(--shadow-sm); }
.react-btn {
    display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
    min-width: 58px;
    padding: 4px 14px;
    background: transparent; border: none;
    font: 700 12.5px/1 inherit; font-family: inherit; color: var(--muted);
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.react-btn + .react-btn { border-left: 1px solid var(--border); }
.react-btn .emo { font-size: 15px; line-height: 1; }
.react-btn .cnt:empty { display: none; }
.react-btn:hover { background: var(--bg); }
.react-btn.voted { background: var(--brand-tint); color: var(--brand-press); }
.chat-msg.mine .chat-body { text-align: left; }
.chat-msg.mine .chat-react { float: right; }
.chat-msg.mine .chat-body::after { content: ""; display: block; clear: both; }

/* Редактиране / изтриване */
.msg-actions {
    position: absolute; top: -12px; right: 8px;
    display: flex; gap: 2px;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    padding: 2px; box-shadow: var(--shadow-sm);
    opacity: 0; pointer-events: none;
    transition: opacity 0.12s;
}
.chat-msg:hover .msg-actions, .msg-actions:focus-within { opacity: 1; pointer-events: auto; }
.chat-msg.editing .msg-actions { display: none; }
.msg-act {
    display: inline-flex; align-items: center; gap: 4px;
    height: 26px; min-width: 26px; padding: 0 6px;
    background: none; border: none; border-radius: 6px;
    color: var(--muted); cursor: pointer;
    font: 600 12px/1 inherit; font-family: inherit;
}
.msg-act svg { width: 15px; height: 15px; }
.msg-act:hover { background: var(--bg); color: var(--brand); }
.msg-act.danger:hover, .msg-act.confirm { color: var(--danger); background: #fdf3f4; }
.chat-edit { margin-top: 4px; }
.chat-edit-input { resize: vertical; min-height: 56px; font-size: 13.5px; line-height: 1.45; }
.chat-edit-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.chat-edit-hint { flex: 1; font-size: 11px; color: var(--muted); }
.chat-edit-btn { padding: 6px 12px; font-size: 12.5px; }
.chat-meta .edited { font-style: italic; }
.chat-gone { color: var(--muted); font-style: italic; }
.chat-msg.deleted .chat-body { background: transparent; border: 1px dashed var(--border); }

.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-send {
    width: 42px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand); color: #fff;
    border: none; border-radius: 8px; cursor: pointer;
}
.chat-send:hover { background: var(--brand-hover); }
.send-svg { width: 18px; height: 18px; }

/* ===== Размер с мишката и уголемяване ===== */
.meeting { gap: 0; }
.meeting .chat { margin-left: 0; }
.splitter {
    width: 16px; flex-shrink: 0;
    cursor: col-resize;
    position: relative;
    touch-action: none;
}
.splitter::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 4px; height: 44px; margin: -22px 0 0 -2px;
    border-radius: 4px; background: #c7c7c7;
    transition: background 0.15s, height 0.15s;
}
.splitter:hover::after, .splitter.dragging::after { background: var(--brand); height: 72px; margin-top: -36px; }
.splitter.dragging { cursor: col-resize; }
body:has(.splitter.dragging) { user-select: none; cursor: col-resize; }

.call-tile { cursor: zoom-in; }
.call-grid.has-spot { grid-template-columns: minmax(0, 1fr) !important; }
.call-grid.has-spot .call-tile:not(.spot) { display: none; }
.call-grid.has-spot .call-tile.spot { cursor: zoom-out; max-height: 100%; }

.call-tile.user-hidden { display: none; }

/* ===== Страничен панел с раздели ===== */
.side-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 6px; flex-shrink: 0; }
.side-tab {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: none; border: none; border-bottom: 3px solid transparent;
    padding: 13px 6px 10px;
    font: 600 13px/1 inherit; font-family: inherit; color: var(--muted);
    cursor: pointer; white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.side-tab:hover { color: var(--text); }
.side-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-count {
    min-width: 19px; height: 19px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--brand-tint); color: var(--brand-press);
    font-size: 11px;
}
.side-sec { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ctl-badge.info { background: var(--brand); }

/* ===== Участници ===== */
.people-actions { display: flex; gap: 8px; padding: 14px 14px 0; }
.people-actions .btn { flex: 1; padding: 8px 10px; font-size: 12.5px; border: 1px solid var(--border); box-shadow: none; }
.people-hint { padding: 10px 16px 4px; color: var(--muted); font-size: 12px; }
.people-list { list-style: none; margin: 0; padding: 6px 8px 14px; overflow-y: auto; flex: 1; min-height: 0; }
.person {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 8px; border-radius: 10px;
    transition: background 0.15s, opacity 0.15s;
}
.person:hover { background: var(--bg); }
.person.is-hidden { opacity: 0.55; }
.person-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; font-weight: 700;
}
.person-info { flex: 1; min-width: 0; }
.person-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tag { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.tag-ok { background: #e7f4ec; color: #1d7a45; }
.tag-off { background: #fdf3f4; color: var(--danger-hover); }
.tag-share { background: var(--brand-tint); color: var(--brand-press); }
.person-switch { display: inline-flex; cursor: pointer; }

/* IP и град под името — дребно */
.person-ip { font-size: 10.5px; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; margin-top: 1px; }
.geo-credit { padding: 6px 16px 12px; font-size: 10px; color: #9e9e9e; }
.geo-credit a { color: inherit; text-decoration: underline; }

/* ===== Сила на звука на участник ===== */
.vol-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.vol-btn {
    width: 28px; height: 28px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%; background: var(--bg); color: var(--brand-press); cursor: pointer;
}
.vol-btn svg { width: 15px; height: 15px; }
.vol-btn:hover { background: var(--brand-tint); }
.vol-range { flex: 1; min-width: 0; accent-color: var(--brand); }
.vol-val { width: 58px; flex-shrink: 0; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vol-row.muted .vol-btn { color: var(--danger); background: #fdf3f4; }
.vol-row.muted .vol-range { opacity: 0.45; }

/* ===== Модален прозорец „Вход за администратори" ===== */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 18, 50, 0.55); backdrop-filter: blur(4px); animation: fade-in 0.15s ease; }
.modal-card {
    position: relative; width: 100%; max-width: 400px;
    max-height: calc(100dvh - 32px); overflow-y: auto;
    background: var(--surface); border-radius: 18px;
    padding: 34px 30px 28px; text-align: center;
    box-shadow: 0 30px 80px rgba(20, 18, 60, 0.45);
    animation: pop-in 0.18s ease;
}
.modal-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 18px 18px 0 0; background: linear-gradient(90deg, var(--brand-light), #b43cb0); }
.modal-card .brand-mark { margin-bottom: 14px; }
.modal-card h2 { font-size: 21px; font-weight: 800; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 6px 0 6px; }
.modal-card .btn-block { margin-top: 20px; }
.modal-x {
    position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
    border: none; border-radius: 50%; background: var(--bg); color: var(--text-2);
    font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-x:hover { background: var(--brand-tint); color: var(--brand-press); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) { .modal-card { padding: 30px 20px 22px; } }

/* ===== Карта „Администрация" в Начало ===== */
.admin-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 22px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.admin-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--brand-light), #b43cb0); }
.admin-card-head { display: flex; align-items: flex-start; gap: 14px; }
.admin-card-head .action-icon { margin: 0; flex-shrink: 0; }
.admin-card-head > div { flex: 1; min-width: 0; }
.admin-logout { flex-shrink: 0; border: 1px solid var(--border); box-shadow: none; }
.admin-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-top: 8px; }
.admin-form .btn { height: 44px; }
.admin-sub { font-size: 13px; font-weight: 700; color: var(--brand-press); text-transform: uppercase; letter-spacing: 0.04em; margin: 20px 0 8px; }
.op-list { list-style: none; margin: 0; padding: 0; }
.op-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.op-info { flex: 1; min-width: 0; }
.op-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.op-remove { padding: 7px 12px; font-size: 12.5px; color: var(--danger); border: 1px solid var(--border); box-shadow: none; }
.op-remove:hover { background: #fdf3f4; color: var(--danger); }
@media (max-width: 720px) {
    .admin-form { grid-template-columns: minmax(0, 1fr); }
    .admin-card-head { flex-wrap: wrap; }
    .admin-logout { width: 100%; }
}

/* ===== Вход за администратор ===== */
.topbar-link { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.topbar-link:hover { color: var(--brand); }
.admin-badge {
    padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--brand-light), #b43cb0);
}
.hero-nav-right { display: inline-flex; align-items: center; gap: 16px; }
.hero-admin { color: rgba(255, 255, 255, 0.85); font-size: 13px; font-weight: 600; }
.hero-admin:hover { color: #fff; text-decoration: underline; }
@media (max-width: 720px) {
    .topbar-link { font-size: 11.5px; }
    .hero-admin { font-size: 12px; }
    .hero-nav-right { gap: 10px; }
}

/* ===== Роли ===== */
.join-role {
    margin-top: 14px; padding: 10px 12px; border-radius: 8px;
    background: var(--brand-tint); color: var(--brand-press);
    font-size: 13px; line-height: 1.45; text-align: left;
}
.join-role.is-viewer { background: #f0f0f0; color: var(--text-2); }
.admin-link { display: inline-block; margin-top: 16px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.admin-link:hover { color: var(--brand); }

.role-pill { margin-left: auto; margin-right: 12px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.role-pill.role-admin { background: linear-gradient(135deg, var(--brand-light), #b43cb0); color: #fff; }
.role-pill.role-operator { background: #2e9e5b; color: #fff; }
.role-pill.role-user { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.85); }

.promote {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin: 0 4px 10px; padding: 10px 14px; border-radius: 12px;
    background: linear-gradient(135deg, #2e9e5b, #1d7a45); color: #fff; font-size: 13.5px;
}
.stage { position: relative; }
.stage-toast {
    position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 6;
    max-width: 90%; padding: 9px 16px; border-radius: 10px;
    background: rgba(20, 20, 30, 0.9); color: #fff; font-size: 13px; font-weight: 600; text-align: center;
    transition: opacity 0.5s;
}
.stage-toast.gone { opacity: 0; }

.tag-role-admin { background: linear-gradient(135deg, var(--brand-light), #b43cb0); color: #fff; }
.tag-role-operator { background: #2e9e5b; color: #fff; }
.tag-role-user { background: #ececec; color: var(--text-2); }
.tag-mute { background: #f5f5f5; color: var(--muted); }
.person-more {
    width: 32px; height: 32px; flex-shrink: 0;
    border: none; border-radius: 50%; background: transparent;
    color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.person-more:hover { background: var(--brand-tint); color: var(--brand-press); }

.ctx-menu {
    position: fixed; z-index: 100; min-width: 220px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-lg); padding: 6px;
}
.ctx-head { padding: 6px 10px 8px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ctx-item {
    display: block; width: 100%; text-align: left;
    padding: 10px 12px; border: none; border-radius: 6px; background: none;
    font: 600 13.5px/1.2 inherit; font-family: inherit; color: var(--text); cursor: pointer;
}
.ctx-item:hover { background: var(--brand-tint); color: var(--brand-press); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: #fdf3f4; }

/* ===== Контроли на камерата в картината ===== */
.tile-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 3; }
.tile-btn, .ptz-btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: none; color: #fff; cursor: pointer;
    transition: background 0.15s;
}
.tile-btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); }
.tile-btn:hover, .ptz-btn:hover { background: var(--brand); }
.tile-btn svg { width: 17px; height: 17px; }

.ptz-pad {
    position: absolute; right: 10px; bottom: 44px; z-index: 3;
    display: flex; align-items: center; gap: 6px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    opacity: 0.55;
    transition: opacity 0.15s;
}
.call-tile:hover .ptz-pad, .ptz-pad:focus-within { opacity: 1; }
.ptz-grid { display: grid; grid-template-columns: repeat(3, 30px); grid-template-rows: repeat(3, 30px); gap: 3px; }
.ptz-zoom { display: flex; flex-direction: column; gap: 3px; }
.ptz-btn { width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, 0.14); touch-action: none; }
.ptz-btn svg { width: 16px; height: 16px; }

.ai-chips { position: absolute; top: 10px; left: 10px; z-index: 3; display: flex; flex-wrap: wrap; gap: 4px; max-width: 70%; }
.ai-chip {
    background: linear-gradient(135deg, var(--brand-light), #b43cb0);
    color: #fff; font-size: 11px; font-weight: 700;
    padding: 3px 9px; border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.tile-toast {
    position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 4;
    max-width: 88%;
    background: rgba(20, 20, 30, 0.85); color: #fff;
    border: 1px solid rgba(127, 133, 245, 0.6);
    padding: 8px 14px; border-radius: 10px;
    font-size: 12.5px; font-weight: 600; text-align: center;
    transition: opacity 0.5s;
}
.tile-toast.gone { opacity: 0; }

/* ===== Панел „Камера и устройства" ===== */
.cam-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 18px; }
.cam-group {
    margin: 18px 0 10px;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--brand-press);
}
.cam-row { margin-bottom: 12px; }
.cam-row > label { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.cam-row .val { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.cam-row input[type=range] { width: 100%; accent-color: var(--brand); }
.cam-row select.field { padding: 8px 10px; }
.cam-summary { margin-top: 12px; padding: 10px 12px; background: var(--brand-tint); color: var(--brand-press); border-radius: 8px; font-size: 12.5px; line-height: 1.45; }
.cam-summary:empty { display: none; }
#cam-reset { margin-top: 16px; }
.switch-row > label { align-items: center; cursor: pointer; }
.switch {
    appearance: none; -webkit-appearance: none;
    width: 38px; height: 22px; flex-shrink: 0;
    border-radius: 999px; background: #c7c7c7;
    position: relative; cursor: pointer;
    transition: background 0.15s;
}
.switch::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%; background: #fff;
    transition: transform 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(16px); }

/* ===== Вход ===== */
.auth-screen { min-height: 100vh; display: flex; }
.auth-side {
    flex: 1;
    background: var(--hero);
    color: #fff;
    padding: 48px 56px;
    display: flex; flex-direction: column; justify-content: center; gap: 28px;
}
.auth-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.auth-brand-name { display: block; font-weight: 800; font-size: 18px; }
.auth-brand-sub { display: block; font-size: 12.5px; opacity: 0.8; }
.auth-side h2 { font-size: 34px; line-height: 1.2; font-weight: 800; max-width: 520px; }
.auth-bubbles { display: flex; }
.auth-bubbles span {
    width: 52px; height: 52px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; border: 3px solid rgba(255, 255, 255, 0.85);
    margin-right: -10px;
}
.auth-card {
    width: 480px; flex-shrink: 0;
    background: var(--surface);
    padding: 56px 52px;
    display: flex; flex-direction: column; justify-content: center;
}
.auth-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 8px; }
.auth-form .btn-block { margin-top: 24px; }
.auth-back { margin-top: 22px; font-size: 13px; font-weight: 600; }

/* ===== Начална страница ===== */
body.landing { background: var(--bg); }
.hero { background: var(--hero); color: #fff; padding-bottom: 80px; overflow: hidden; }
.hero-nav { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; }
.hero-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.hero-brand-name { display: block; font-weight: 800; font-size: 17px; }
.hero-brand-sub { display: block; font-size: 12px; opacity: 0.82; }
.hero-body {
    max-width: 1180px; margin: 0 auto;
    padding: 44px 24px 0;
    display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center;
}
.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px; padding: 6px 14px;
    font-size: 12.5px; font-weight: 600;
}
.hero-copy h1 { font-size: 44px; line-height: 1.12; font-weight: 800; margin: 18px 0 16px; }
.hero-copy p { font-size: 17px; line-height: 1.6; opacity: 0.9; max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.mock {
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(18, 16, 60, 0.5);
    transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
}
.mock-bar { height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #f0f0f0; font-size: 11px; color: var(--muted); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.mock-bar i:nth-child(2) { background: #febc2e; }
.mock-bar i:nth-child(3) { background: #28c840; }
.mock-bar span { margin-left: 8px; }
.mock-body { display: flex; height: 310px; }
.mock-rail { width: 44px; background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0; }
.mock-rail b { width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.25); }
.mock-rail b.on { background: #fff; }
.mock-rail b.mock-logo { background: linear-gradient(135deg, var(--brand-light), var(--brand-hover)); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4); }
.mock-stage { flex: 1; background: var(--stage); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mock-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mock-tile { position: relative; background: #2d2d2d; border-radius: 7px; display: flex; align-items: center; justify-content: center; border: 2px solid transparent; }
.mock-tile.speaking { border-color: var(--speak); }
.mock-tile span { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; }
.mock-tile em { position: absolute; left: 6px; bottom: 5px; font-style: normal; font-size: 9px; color: #fff; background: rgba(0, 0, 0, 0.5); padding: 1px 5px; border-radius: 3px; }
.mock-ctl { display: flex; justify-content: center; gap: 6px; }
.mock-ctl i { width: 24px; height: 16px; border-radius: 4px; background: #3d3d3d; }
.mock-ctl i.red { background: var(--danger); }
.mock-chat { width: 118px; background: #fff; border-left: 1px solid #eee; padding: 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.mock-chat p { display: flex; align-items: center; gap: 5px; }
.mock-chat span { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.mock-chat em { height: 9px; flex: 1; border-radius: 4px; background: #ececec; }
.mock-chat em.short { flex: none; width: 55%; }
.mock-chat p.mine { justify-content: flex-end; }
.mock-chat p.mine em { flex: none; width: 70%; background: var(--brand-tint); }

.features { max-width: 1180px; margin: 0 auto; padding: 56px 24px 64px; }
.features h2 { font-size: 26px; font-weight: 800; margin-bottom: 22px; }
.action-card.static:hover { transform: translateY(-3px); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.fact {
    display: flex; flex-direction: column; gap: 4px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}
.fact .fact-svg.big { width: 30px; height: 30px; margin-bottom: 8px; }
.fact b { font-size: 17px; }
.fact span { color: var(--muted); font-size: 13px; }

.site-footer { background: var(--surface); border-top: 1px solid var(--border); }
.site-footer-inner { max-width: 1180px; margin: 0 auto; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer .hero-brand { color: var(--text); }
.footer-name { display: block; font-weight: 800; }
.footer-sub { display: block; font-size: 12px; color: var(--muted); }
.footer-copy { font-size: 12.5px; color: var(--muted); }

/* ===== Височина: мобилните браузъри имат ленти, които се показват/крият ===== */
.shell { height: 100vh; height: 100dvh; }
.auth-screen { min-height: 100vh; min-height: 100dvh; }
.side-close {
    display: none; flex: 0 0 auto; align-self: center;
    width: 36px; height: 36px; margin-left: 4px;
    align-items: center; justify-content: center;
    background: var(--bg); color: var(--text-2);
    border: none; border-radius: 50%;
    font-size: 22px; line-height: 1; cursor: pointer;
}
.side-close:hover { background: var(--brand-tint); color: var(--brand-press); }

/* Тъчекрани: нещата, които на компютър излизат при посочване, се виждат винаги */
@media (hover: none) {
    .msg-actions { opacity: 1; pointer-events: auto; position: static; display: inline-flex; margin-top: 6px; box-shadow: none; }
    .chat-react { opacity: 1; }
    .ptz-pad { opacity: 1; }
    .call-tile { cursor: default; }
    .ptz-btn { width: 38px; height: 38px; }
    .ptz-grid { grid-template-columns: repeat(3, 38px); grid-template-rows: repeat(3, 38px); }
    .tile-btn { width: 40px; height: 40px; }
    .react-btn { padding: 7px 16px; }
}

/* ===== Таблети и малки лаптопи ===== */
@media (max-width: 980px) {
    .hero-body { grid-template-columns: 1fr; gap: 36px; }
    .mock { transform: none; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-side { display: none; }
    .auth-card { width: 100%; max-width: 520px; margin: 0 auto; padding: 48px 32px; }
    .auth-screen { background: var(--hero); align-items: center; justify-content: center; padding: 16px; }
    .auth-screen .auth-card { border-radius: 18px; box-shadow: var(--shadow-lg); min-height: 0; }
    .side { position: fixed; right: 12px; top: 68px; bottom: 12px; width: min(380px, calc(100vw - 24px)) !important; z-index: 40; box-shadow: var(--shadow-lg); }
    .splitter { display: none; }
    .side-close { display: inline-flex; }
    .welcome { padding: 24px; }
}

/* ===== Телефони ===== */
@media (max-width: 720px) {
    body { font-size: 15px; }
    /* под 16px iPhone увеличава страницата при писане */
    .field, .chat-edit-input, select.field { font-size: 16px; }

    /* лентата отляво става долна навигация */
    .shell { flex-direction: column-reverse; }
    .rail {
        width: 100%; flex-direction: row; justify-content: space-around; align-items: stretch;
        gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
        background: linear-gradient(90deg, #4a4d9e, #33356e);
    }
    .rail-brand, .rail-spacer { display: none; }
    .rail-item { flex: 1; width: auto; min-width: 0; padding: 7px 2px 5px; font-size: 10px; }
    .rail-item span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rail-item.active::before { left: 25%; right: 25%; top: -4px; bottom: auto; width: auto; height: 3px; }
    .rail-svg { width: 22px; height: 22px; }

    .topbar { height: 52px; padding: 0 14px; padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
    .topbar-title { font-size: 15px; min-width: 0; }
    .topbar-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .room-pill { display: none; }
    .page { padding: 16px 14px; }

    /* начало / секции */
    .welcome { flex-direction: column; align-items: stretch; padding: 22px 20px; }
    .welcome h1 { font-size: 22px; }
    .welcome .btn { width: 100%; }
    .card-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .section-hero { flex-direction: column; align-items: flex-start; }
    .empty-card { padding: 32px 18px; }

    /* начална страница */
    .hero { padding-bottom: 48px; }
    .hero-nav { padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top)); }
    .hero-brand-sub { display: none; }
    .hero-nav .btn { padding: 9px 14px; font-size: 13px; }
    .hero-body { padding: 18px 16px 0; gap: 28px; }
    .hero-copy h1 { font-size: 30px; }
    .hero-copy p { font-size: 15.5px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; white-space: normal; }
    .mock-body { height: 200px; }
    .mock-chat { display: none; }
    .features { padding: 36px 16px 44px; }
    .features h2 { font-size: 22px; }
    .facts { grid-template-columns: minmax(0, 1fr); }
    .site-footer-inner { flex-direction: column; align-items: flex-start; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }

    /* вход */
    .auth-card { padding: 34px 22px; }
    .auth-card h1 { font-size: 21px; }

    /* ---- видеоразговор: навигацията се скрива, видеото е на цял екран ---- */
    .page-video .rail { display: none; }
    .page-video .page { padding: 0; }
    .page-video .prejoin { padding: 16px; }
    .prejoin-card { padding: 28px 20px 24px; border-radius: 16px; }
    .prejoin-avatar { width: 76px; height: 76px; font-size: 28px; }
    .meeting { margin: 0; }
    .stage { border-radius: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
    .stage-top { padding: 2px 4px 8px; font-size: 12px; }
    .call-grid { gap: 6px; align-content: start; }
    .call-grid, .call-grid[data-count] { grid-template-columns: minmax(0, 1fr); }
    .call-tile { border-radius: 10px; }
    .tile-avatar { width: 64px; height: 64px; font-size: 22px; }
    .call-controls {
        flex-wrap: nowrap; justify-content: flex-start; gap: 6px;
        overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
        padding: 8px 2px 2px;
    }
    .call-controls::-webkit-scrollbar { display: none; }
    .ctl { flex: 0 0 auto; min-width: 54px; height: 54px; padding: 0 10px; justify-content: center; border-radius: 14px; }
    .ctl-label { display: none; }
    .ctl-svg { width: 22px; height: 22px; }
    .ptz-pad { bottom: 40px; right: 6px; }

    /* страничният панел — цял екран отдолу */
    .side {
        left: 0; right: 0; bottom: 0; top: calc(52px + env(safe-area-inset-top));
        width: 100% !important; border-radius: 16px 16px 0 0; border: none;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .side-tab { padding: 14px 4px 11px; font-size: 12.5px; gap: 4px; }
    .side-tab .pill-svg { display: none; }
    .chat-form { padding: 10px; }
    .chat-send { width: 48px; }
    .link-card { width: 100%; }
}

/* изправен телефон с 3+ участници — по два на ред, по-високи плочки */
@media (max-width: 720px) and (orientation: portrait) {
    .call-grid[data-count="3"], .call-grid[data-count="4"],
    .call-grid[data-count="5"], .call-grid[data-count="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .call-grid[data-count="3"] .call-tile, .call-grid[data-count="4"] .call-tile,
    .call-grid[data-count="5"] .call-tile, .call-grid[data-count="6"] .call-tile { aspect-ratio: 3 / 4; }
    .call-grid[data-count="2"] .call-tile { aspect-ratio: 4 / 3; }
}

/* легнал телефон — два до три на ред, контролите по-ниски */
@media (max-height: 500px) and (orientation: landscape) {
    .page-video .rail { display: none; }
    .page-video .topbar { display: none; }
    .page-video .page { padding: 0; }
    .call-grid, .call-grid[data-count] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .call-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); max-width: 70vh; }
    .ctl { height: 44px; min-width: 46px; }
    .stage-top { display: none; }
    .side { top: 8px; }
}

/* много тесни екрани (320px) */
@media (max-width: 360px) {
    .hero-copy h1 { font-size: 26px; }
    .side-tab { font-size: 11.5px; }
    .ctl { min-width: 48px; height: 50px; padding: 0 8px; }
    .rail-item { font-size: 9px; }
}
