/* Темы (базовая в style.css — «Ретро 94») */
:root[data-theme="honey"] { --bg:#120f0a; --bg-2:#19150e; --panel:#1f1a12; --panel-2:#2a2318; --panel-3:#362d1f; --line:#3a3122; --text:#f6efe2; --muted:#ad9f88; --faint:#7d7160; --honey:#ffb627; --honey-2:#ff8f1f; --on-honey:#1c1405; --mint:#2dd4a7; --red:#ff5d4d; --blue:#6fd3f5; --own:#4a3510; color-scheme:dark; }
:root[data-theme="midnight"] { --bg:#0b0e1a; --bg-2:#10142404; --bg-2:#111526; --panel:#161b30; --panel-2:#20263f; --panel-3:#2c3352; --line:#2e3555; --text:#eceefb; --muted:#a2a8c8; --faint:#767c9e; --honey:#7c8cff; --honey-2:#5f6ff0; --on-honey:#0b0e1a; --own:#2f3a78; color-scheme:dark; }
:root[data-theme="graphite"] { --bg:#121314; --bg-2:#191a1c; --panel:#1f2023; --panel-2:#2a2c30; --panel-3:#383a3f; --line:#35373b; --text:#f1f1f2; --muted:#a9abb0; --faint:#7c7e84; --honey:#e6e6e6; --honey-2:#c9c9c9; --on-honey:#121314; --own:#3c3f45; color-scheme:dark; }
:root[data-theme="forest"] { --bg:#0b1410; --bg-2:#101c16; --panel:#15241c; --panel-2:#1e3228; --panel-3:#2a4336; --line:#294034; --text:#e9f6ee; --muted:#9dbcaa; --faint:#6f8f7d; --honey:#4ade80; --honey-2:#22c55e; --on-honey:#06180e; --own:#1d5236; color-scheme:dark; }
:root[data-theme="ocean"] { --bg:#071620; --bg-2:#0c202e; --panel:#102838; --panel-2:#18374b; --panel-3:#23495f; --line:#224558; --text:#e6f4fb; --muted:#97b9ca; --faint:#6a8c9e; --honey:#38bdf8; --honey-2:#0ea5e9; --on-honey:#04202e; --own:#125070; color-scheme:dark; }
:root[data-theme="sakura"] { --bg:#1a0f15; --bg-2:#23141c; --panel:#2b1922; --panel-2:#3a2330; --panel-3:#4c2f3f; --line:#4a2e3d; --text:#fdeef4; --muted:#cfa6b8; --faint:#9c7788; --honey:#ff8fb8; --honey-2:#f76da0; --on-honey:#2b0b19; --own:#6d2c49; color-scheme:dark; }
:root[data-theme="grape"] { --bg:#150e20; --bg-2:#1c132b; --panel:#231835; --panel-2:#302247; --panel-3:#402e5d; --line:#3e2d59; --text:#f3edfc; --muted:#b8a8d2; --faint:#8877a3; --honey:#c084fc; --honey-2:#a855f7; --on-honey:#1b0b2e; --own:#4f2f80; color-scheme:dark; }
:root[data-theme="ember"] { --bg:#170c09; --bg-2:#20110d; --panel:#291611; --panel-2:#381f18; --panel-3:#4a2a20; --line:#472a20; --text:#fdeee8; --muted:#cfa899; --faint:#9c7869; --honey:#ff6b3d; --honey-2:#f04d1c; --on-honey:#240b03; --own:#70301c; color-scheme:dark; }
:root[data-theme="frost"] { --bg:#1b2230; --bg-2:#222a3a; --panel:#293244; --panel-2:#343f54; --panel-3:#434f67; --line:#414c63; --text:#eceff4; --muted:#b4bdcc; --faint:#8791a3; --honey:#88c0d0; --honey-2:#6fb0c4; --on-honey:#14202a; --own:#3f6577; color-scheme:dark; }
:root[data-theme="oled"] { --bg:#000; --bg-2:#070707; --panel:#0c0c0c; --panel-2:#181818; --panel-3:#262626; --line:#242424; --text:#f5f5f5; --muted:#a3a3a3; --faint:#767676; --own:#3d2d0c; color-scheme:dark; }
:root[data-theme="nectar"] { --bg:#f3ecdf; --bg-2:#fbf6ec; --panel:#fffaf1; --panel-2:#f2e8d6; --panel-3:#e8dbc3; --line:#e2d4bb; --text:#271e10; --muted:#6a5d4a; --faint:#857761; --honey:#d98a00; --honey-2:#c27803; --on-honey:#1c1405; --own:#ffe3a6; --blue:#0b6fa8; --mint:#0f9d76; color-scheme:light; }
:root[data-theme="paper"] { --bg:#ebe6db; --bg-2:#f4f1ea; --panel:#fbf9f4; --panel-2:#ece7dc; --panel-3:#dfd8c9; --line:#d9d1c1; --text:#25241f; --muted:#625f55; --faint:#807c70; --honey:#3f6b4f; --honey-2:#325a41; --on-honey:#fff; --own:#d7e6d5; --blue:#1f6a8f; --mint:#2c8a63; color-scheme:light; }
:root[data-theme="sky"] { --bg:#dfecf7; --bg-2:#eef5fb; --panel:#fbfdff; --panel-2:#e6f0f8; --panel-3:#d4e4f1; --line:#cfe0ee; --text:#10243a; --muted:#4d647c; --faint:#6e8499; --honey:#1677c9; --honey-2:#0f64ab; --on-honey:#fff; --own:#cfe6fb; --blue:#0f64ab; --mint:#0c8f6c; color-scheme:light; }
:root[data-theme="nectar"] .body code, :root[data-theme="paper"] .body code, :root[data-theme="sky"] .body code,
:root[data-theme="nectar"] .quote, :root[data-theme="paper"] .quote, :root[data-theme="sky"] .quote,
:root[data-theme="nectar"] .opt, :root[data-theme="paper"] .opt, :root[data-theme="sky"] .opt,
:root[data-theme="nectar"] .react, :root[data-theme="paper"] .react, :root[data-theme="sky"] .react,
:root[data-theme="nectar"] .att-file, :root[data-theme="paper"] .att-file, :root[data-theme="sky"] .att-file { background: #0000000f; }
:root[data-theme="nectar"] .body pre, :root[data-theme="paper"] .body pre, :root[data-theme="sky"] .body pre { background: #00000012; }
:root[data-theme="nectar"] .ava, :root[data-theme="paper"] .ava, :root[data-theme="sky"] .ava { color: #1a1305; }

/* Форма, плотность, фон */
:root { --msg-size: 15px; --ava-shape: var(--hex); --bubble-r: 15px; --msg-gap: 9px; --msg-pad: 7px 11px 6px; }
:root[data-avatar="circle"] { --ava-shape: circle(50%); } :root[data-avatar="square"] { --ava-shape: inset(0 round 24%); }
:root[data-bubbles="soft"] { --bubble-r: 9px; } :root[data-bubbles="sharp"] { --bubble-r: 3px; }
:root[data-density="compact"] { --msg-gap: 4px; --msg-pad: 4px 9px 3px; } :root[data-density="roomy"] { --msg-gap: 16px; --msg-pad: 10px 14px 9px; }
.ava .pic { clip-path: var(--ava-shape); }
.bubble { border-radius: var(--bubble-r); padding: var(--msg-pad); }
.msg.first { margin-top: var(--msg-gap); }
.body, .capsule, .live-card { font-size: var(--msg-size); }
:root[data-wall="none"] .main::before { display: none; }
:root[data-wall="dots"] .main::before { opacity: .09; background-image: radial-gradient(var(--honey) 1.2px, transparent 1.4px); background-size: 20px 20px; }
:root[data-wall="lines"] .main::before { opacity: .05; background-image: repeating-linear-gradient(135deg, var(--honey) 0 1px, transparent 1px 16px); }
:root[data-motion="off"] * { animation: none !important; transition: none !important; }

/* Стабильная вёрстка строк */
.msg { align-items: flex-start; }
.card.row { display: flex; }
.body { display: block; min-width: 0; }
.body::after { content: ""; display: block; clear: both; }
.meta { float: right; line-height: 1; margin: 6px 0 0 10px; white-space: nowrap; }
.meta .ico { display: inline-block; }
.body code { vertical-align: baseline; line-height: 1.2; }
.who { display: flex; max-width: 100%; margin-bottom: 1px; text-align: left; }
.item > .grow, .item .grow > .row { min-width: 0; }
.item .grow > .row { display: flex; }
.item .t, .item .s { line-height: 1.3; }
.head > button.grow { min-width: 0; display: block; }
.head-sub { gap: 7px; flex-wrap: nowrap; min-width: 0; } .head-sub > .ellipsis { min-width: 0; }
.sec button { color: var(--faint); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; } .sec button:hover { background: var(--panel-3); color: var(--text); }
.btn { white-space: nowrap; min-width: 0; line-height: 1.25; }
.chip { flex: none; }
.field { min-width: 0; }

/* Лента строками */
:root[data-layout="lines"] .msg, :root[data-layout="lines"] .msg.mine { flex-direction: row; }
:root[data-layout="lines"] .bubble, :root[data-layout="lines"] .msg.mine .bubble { flex: 1; max-width: 100%; background: none; padding: 1px 6px; border-radius: 6px; }
:root[data-layout="lines"] .msg:hover .bubble { background: var(--panel-2); }
:root[data-layout="lines"] .msg.mine .tools { left: auto; right: 8px; }

/* Новые элементы сообщений */
.heat { display: inline-flex; flex: none; align-items: center; gap: 3px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 750; line-height: 17px; }
.heat.cool { color: #6fd3f5; background: #6fd3f51f; } .heat.warm { color: #ffb627; background: #ffb62724; } .heat.hot { color: #ff6b4a; background: #ff6b4a2b; }
.capsule { display: flex; align-items: center; gap: 11px; min-width: min(250px, 58vw); padding: 9px 11px; margin: 2px 0; border-radius: 11px; border: 1px dashed var(--honey); background: color-mix(in srgb, var(--honey) 12%, transparent); } .capsule .ico { color: var(--honey); }
.live-card { display: flex; flex-direction: column; gap: 5px; min-width: min(290px, 62vw); padding: 9px 11px; margin: 2px 0; border-radius: 11px; background: color-mix(in srgb, var(--mint) 13%, transparent); } .live-card > .row { gap: 7px; } .live-card .ico { color: var(--mint); }
.live-card ol { list-style: none; margin: 3px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; } .live-card li { display: flex; gap: 8px; } .live-card time { color: var(--mint); font-variant-numeric: tabular-nums; font-weight: 700; flex: none; }

/* Сцена эфира */
.stage { position: relative; z-index: 2; height: min(56vh, 560px); min-height: 220px; max-height: none; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 14px; background: #0c0a06; color: #f6efe2; border-bottom: 1px solid var(--line); }
.stage:fullscreen { height: 100vh !important; padding: 12px; }
.stage-bar { display: flex; align-items: center; gap: 6px; flex: none; min-width: 0; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 10px; background: #ffffff14; } .seg button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: 12px; font-weight: 650; white-space: nowrap; opacity: .78; } .seg button.active { background: var(--honey); color: var(--on-honey); opacity: 1; }
.seg.wide { display: flex; background: var(--panel-2); flex-wrap: wrap; } .seg.wide button { flex: 1 1 auto; justify-content: center; padding: 6px 10px; font-size: 13px; opacity: 1; color: var(--muted); } .seg.wide button.active { color: var(--on-honey); }
.stage-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 9px; background: #ffffff14; font-size: 12px; font-weight: 650; white-space: nowrap; } .stage-btn:hover { background: #ffffff26; } .stage-btn.icon { width: 30px; padding: 0; justify-content: center; }
.tiles { position: relative; flex: 1; min-height: 0; display: grid; gap: 8px; grid-template-columns: none; overflow: hidden; }
.tiles[data-layout="free"] { display: block; background: #ffffff08; border-radius: 12px; }
.tile { position: relative; min-width: 0; min-height: 0; border-radius: 12px; background: #221b10; display: grid; place-items: center; overflow: hidden; border: 2px solid transparent; transition: border-color .12s; }
.tile.speaking { border-color: var(--mint); } .tile.wide { grid-column: auto; min-height: 0; }
.tiles[data-layout="free"] .tile { cursor: move; box-shadow: 0 8px 26px #000a; touch-action: none; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; } .tile video.mirror { transform: scaleX(-1); object-fit: contain; }
.tile .tag { position: absolute; z-index: 2; left: 6px; bottom: 6px; max-width: calc(100% - 12px); display: flex; gap: 4px; align-items: center; padding: 2px 7px; border-radius: 7px; background: #000b; color: #fff; font-size: 12px; font-weight: 650; } .tile .tag small { opacity: .75; flex: none; }
.tile-tools { position: absolute; z-index: 3; top: 5px; right: 5px; display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: #000b; color: #fff; opacity: 0; transition: opacity .12s; } .tile:hover .tile-tools, .tile:focus-within .tile-tools { opacity: 1; } .tile-tools button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; } .tile-tools button:hover { background: #ffffff2e; }
.tile-corner { display: none; position: absolute; z-index: 4; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 52%, var(--honey) 52%); border-bottom-right-radius: 10px; } .tiles[data-layout="free"] .tile-corner { display: block; }
.controls { flex: none; } .ctl { width: 40px; height: 40px; } .ctl.end { width: 56px; }
.stage-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; display: grid; place-items: center; cursor: ns-resize; touch-action: none; } .stage-grip span { width: 46px; height: 4px; border-radius: 4px; background: #ffffff40; } .stage-grip:hover span { background: var(--honey); }

/* Настройки */
.modal.settings-modal { width: min(860px, 100%); height: min(680px, 88vh); } .settings-modal .modal-body { flex: 1; min-height: 0; padding: 0; overflow: hidden; }
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); height: 100%; min-height: 0; border-top: 1px solid var(--line); }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; background: var(--bg-2); overflow-y: auto; border-bottom-left-radius: 20px; } .set-nav button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-weight: 600; text-align: left; } .set-nav button:hover { background: var(--panel-2); } .set-nav button.active { background: var(--panel-3); color: var(--text); }
.set-pane { padding: 16px 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.set-group { display: flex; flex-direction: column; gap: 9px; } .set-group + .set-group { padding-top: 13px; border-top: 1px solid var(--line); } .set-group h4 { margin: 0; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.set-list { display: flex; flex-direction: column; gap: 9px; } .set-row { display: flex; align-items: center; gap: 12px; cursor: default; } label.set-row { cursor: pointer; } .set-row.col { flex-direction: column; align-items: stretch; gap: 5px; } .set-label { display: block; font-weight: 600; } .set-row small { display: block; color: var(--muted); }
.set-row input[type="range"] { width: 100%; accent-color: var(--honey); }
.switch { position: relative; flex: none; width: 40px; height: 23px; } .switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; } .switch i { display: block; height: 100%; border-radius: 99px; background: var(--panel-3); transition: background .15s; pointer-events: none; } .switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; } .switch input:checked + i { background: var(--honey); } .switch input:checked + i::after { transform: translateX(17px); } .switch input:focus-visible + i { outline: 2px solid var(--honey); outline-offset: 2px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 7px; } .theme-grid button { display: flex; flex-direction: column; gap: 5px; padding: 5px; border-radius: 11px; border: 2px solid transparent; font-size: 12px; font-weight: 650; text-align: center; min-width: 0; } .theme-grid button:hover { background: var(--panel-2); } .theme-grid button.active { border-color: var(--honey); }
.swatch { display: flex; align-items: flex-end; gap: 4px; height: 50px; padding: 7px; border-radius: 7px; border: 1px solid #8884; } .swatch i { display: block; height: 11px; width: 42%; border-radius: 5px; } .swatch i + i { width: 26%; margin-left: auto; height: 17px; }
.accents { display: flex; flex-wrap: wrap; gap: 7px; } .accents button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-3); color: var(--muted); } .accents button.active { outline: 2px solid var(--text); outline-offset: 2px; }
.color { width: 56px; height: 42px; padding: 0; background: none; border: 0; }
.cam-preview { width: 100%; max-height: 240px; border-radius: 12px; background: #000; object-fit: contain; }
.lang-list { display: flex; flex-direction: column; gap: 3px; } .lang-list button { display: flex; align-items: center; padding: 10px 12px; border-radius: 10px; font-weight: 600; text-align: left; } .lang-list button:hover { background: var(--panel-2); } .lang-list button.active { background: var(--panel-3); }

@media (max-width: 820px) {
  .stage { height: 46dvh; } .stage-bar .seg span, .stage-btn span { display: none; } .tile-tools { opacity: 1; }
  .overlay:has(.settings-modal) { padding: 0; } .modal.settings-modal { width: 100%; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  .settings { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); } .set-nav { flex-direction: row; overflow-x: auto; border-radius: 0; scrollbar-width: none; } .set-nav button { flex: none; } .set-pane { padding: 14px 16px 24px; }
}
