/* OpenSpeak — tema escuro inspirado no TeamSpeak 6
   (cores-base extraídas de main.css: --tsv-contrast-bg #131824, tint #16bcfb,
   online #13f78d, ícone dourado #daa520). */

:root {
  --bg: #0f131c;
  --bg-contrast: #131824;
  --panel: #171d2b;
  --panel-2: #1c2333;
  --panel-3: #232b3e;
  --border: #262e42;
  --border-strong: #333d55;
  --text: #e3e7ef;
  --text-dim: #9aa3b5;
  --text-faint: #6b7489;
  --accent: #16bcfb;
  --accent-strong: #0ea5e0;
  --accent-soft: rgba(22, 188, 251, .14);
  --online: #13f78d;
  --gold: #daa520;
  --live: #f0384b;
  --attention: #e8364a;
  --warn: #f5a623;
  --danger: #f0384b;
  --grid-line: rgba(255, 255, 255, .06);
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon.big { width: 48px; height: 48px; }
.spacer { flex: 1; }
.muted { color: var(--text-dim); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.tag {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; letter-spacing: .02em;
}

/* ---------------------------------------------------------------- botões */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--panel-3);
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: #2b3550; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { height: 26px; padding: 0 10px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #041621; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); }
.btn.attention { background: var(--attention); border-color: var(--attention); color: #fff; font-weight: 600; }
.btn.attention:hover:not(:disabled) { background: #c92b3d; }
.btn.danger { color: var(--danger); }
.btn.warn { background: rgba(245, 166, 35, .15); border-color: rgba(245, 166, 35, .4); color: var(--warn); }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-dim); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.ok:hover:not(:disabled) { color: var(--online); }
.icon-btn.danger:hover:not(:disabled) { color: var(--danger); }

.spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255, 255, 255, .25); border-top-color: currentColor;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- forms */

.input {
  width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-contrast); outline: none;
}
.input:focus { border-color: var(--accent); }
select.input { padding-right: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field.inline .input { width: auto; flex: 1; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.info-dot { color: var(--text-faint); cursor: help; }
.info-dot .icon { width: 14px; height: 14px; }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.hint.warn { color: var(--warn); }
.range { width: 100%; accent-color: var(--accent); }

.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
  background: var(--bg-contrast); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.segmented button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border: none; border-radius: 4px; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 13px;
}
.segmented button .icon { width: 15px; height: 15px; }
.segmented button:hover:not(:disabled) { color: var(--text); background: var(--panel-3); }
.segmented button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.segmented button:disabled { opacity: .4; cursor: not-allowed; }
.segmented.small button { height: 24px; font-size: 12px; }

.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; padding: 4px 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui {
  position: relative; width: 34px; height: 18px; border-radius: 9px; background: var(--panel-3);
  border: 1px solid var(--border-strong); transition: background .15s; flex: none;
}
.toggle-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-dim); transition: transform .15s, background .15s;
}
.toggle input:checked + .toggle-ui { background: var(--accent-soft); border-color: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(16px); background: var(--accent); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- login */

.login { height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #18213a, var(--bg) 70%); }
.login-card {
  width: min(380px, calc(100vw - 32px)); padding: 28px; display: flex; flex-direction: column; gap: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.login-logo { display: flex; align-items: center; gap: 12px; color: var(--accent); margin-bottom: 4px; }
.login-logo h1 { color: var(--text); font-size: 24px; }
.login-status { min-height: 20px; font-size: 13px; color: var(--text-dim); text-align: center; }

/* ---------------------------------------------------------------- layout */

.app { height: 100%; display: flex; flex-direction: column; }
.titlebar {
  height: 44px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--bg-contrast); border-bottom: 1px solid var(--border);
}
.titlebar > .icon { color: var(--accent); }
.brand { font-weight: 700; letter-spacing: .02em; }
.sep { width: 1px; height: 20px; background: var(--border-strong); }
.server-name { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); }
.status-bar { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 8px var(--online); }
.app-body { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 280px; flex: none; background: var(--panel); border-right: 1px solid var(--border); overflow-y: auto; }
.content { flex: 1; min-width: 0; display: flex; }

/* ---------------------------------------------------------- channel tree */

.channel-tree { padding: 8px 6px 16px; user-select: none; }
.tree-server { display: flex; align-items: center; gap: 8px; padding: 8px 8px 10px; font-weight: 600; }
.tree-server .icon { color: var(--gold); }
.tree-row { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px; border-radius: var(--radius-sm); }
.channel-row { cursor: default; color: var(--text-dim); font-weight: 500; }
.channel-row:hover { background: var(--panel-3); color: var(--text); }
.channel-row .icon { width: 16px; height: 16px; color: var(--text-faint); }
.tree-channel.current > .channel-row { color: var(--text); }
.tree-channel.current > .channel-row .icon { color: var(--accent); }
.channel-live { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--live); }
.channel-live .icon { width: 14px; height: 14px; color: var(--live) !important; }
.client-row { padding-left: 26px; color: var(--text); }
.client-row:hover { background: var(--panel-2); }
.client-row.me { font-weight: 600; }
.talk-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--online); flex: none; }
.contact-star { color: var(--gold); }
.contact-star .icon { width: 13px; height: 13px; }
.stream-row { padding-left: 44px; height: 24px; font-size: 12.5px; color: var(--text-dim); }
.stream-row .icon { width: 14px; height: 14px; }
.stream-row.clickable { cursor: pointer; }
.stream-row.clickable:hover { background: var(--panel-2); color: var(--text); }
.stream-row.watching { color: var(--accent); }
.live-badge {
  margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  background: var(--live); color: #fff; padding: 1px 5px; border-radius: 3px;
}
.viewer-count { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.viewer-count .icon { width: 14px; height: 14px; }

.context-menu, .popover {
  position: fixed; z-index: 50; background: var(--panel-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.context-menu { padding: 4px; }
.context-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: none;
  background: transparent; border-radius: 4px; cursor: pointer; text-align: left;
}
.context-menu button:hover { background: var(--panel-3); }
.popover { min-width: 260px; max-width: 360px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.popover h4 { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }

/* ----------------------------------------------------------- stream area */

.stream-area { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.stream-stage-wrap { position: relative; flex: 1; min-height: 0; padding: 10px; }
.stream-stage { position: relative; width: 100%; height: 100%; }
.stream-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--text-dim); text-align: center; padding: 20px;
}
.stream-empty .icon.big { color: var(--border-strong); }
.stream-empty h3 { color: var(--text); font-size: 17px; }
.stream-empty .btn { margin-top: 8px; }
.pager {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 34px; height: 64px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: rgba(23, 29, 43, .85); display: grid; place-items: center; cursor: pointer;
}
.pager.prev { left: 4px; }
.pager.next { right: 4px; }
.pager:hover { background: var(--panel-3); }

.stream-toolbar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-top: 1px solid var(--border); background: var(--panel);
}
.toolbar-count { color: var(--text-dim); font-size: 13px; margin-left: 6px; }

.video-stream {
  position: absolute; top: 0; left: 0; overflow: hidden;
  background: #05070b; border-radius: var(--radius); border: 1px solid var(--border);
  transition: transform .2s ease, width .2s ease, height .2s ease;
}
.video-stream.own { border-color: rgba(240, 56, 75, .45); }
.video-stream.focused { border-color: var(--accent); }
.video-stream:fullscreen { border-radius: 0; border: none; transform: none !important; width: 100% !important; height: 100% !important; }
.tile-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-stream.paused .tile-video { filter: grayscale(.8) brightness(.45); }
.tile-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }

.tile-top {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-width: 0;
  background: linear-gradient(rgba(0, 0, 0, .65), transparent); font-size: 13px;
  opacity: 0; transition: opacity .15s;
}
.tile-actions {
  display: flex; align-items: center; gap: 2px; padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  opacity: 0; transition: opacity .15s;
}
.video-stream:hover .tile-top, .video-stream:hover .tile-actions,
.video-stream:focus-within .tile-top, .video-stream:focus-within .tile-actions,
.tile-actions.always { opacity: 1; }
.video-stream .tile-top:has(.issue-indicator) { opacity: 1; }
.video-stream:fullscreen .tile-top, .video-stream:fullscreen .tile-actions { opacity: 1; }
.video-stream:fullscreen.fullscreen-idle { cursor: none; }
.video-stream:fullscreen.fullscreen-idle .tile-top,
.video-stream:fullscreen.fullscreen-idle .tile-actions {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.video-stream:fullscreen.fullscreen-idle * { cursor: none; }
.tile-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.tile-title .icon { width: 15px; height: 15px; color: var(--text-dim); }
.tile-owner { color: var(--text-dim); white-space: nowrap; }
.badge.live {
  font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 3px;
  background: var(--live); color: #fff; animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .75; } }
.issue-indicator { display: inline-grid; place-items: center; cursor: pointer; }
.issue-indicator.minor { color: var(--warn); }
.issue-indicator.major { color: var(--danger); }
.tile-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: none; border-radius: 6px;
  background: transparent; color: #fff; cursor: pointer;
}
.tile-btn:hover { background: rgba(255, 255, 255, .14); }
.tile-btn.danger:hover { background: var(--danger); }
.tile-btn.attention { color: var(--warn); }
.btn-badge-wrap { position: relative; display: inline-flex; }
.btn-badge {
  position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--warn); color: #000; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}
.video-stream.small .tile-btn { width: 26px; height: 26px; }
.video-stream.small .tile-top { padding: 4px 6px; font-size: 12px; }
.video-stream.small .volume-slider { display: none; }
.tile-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.paused-label {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 20px;
  background: rgba(0, 0, 0, .6); font-weight: 600; letter-spacing: .03em;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 20px;
  background: rgba(0, 0, 0, .55); color: var(--text); font-size: 13px;
}
.volume { display: inline-flex; align-items: center; }
.volume-slider { width: 80px; accent-color: var(--accent); }

.stream-preview { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.stream-preview__thumb {
  position: absolute; inset: -20px; background-size: cover; background-position: center;
  filter: blur(14px) brightness(.4); transform: scale(1.05);
}
.stream-preview__user-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px; text-align: center; max-width: 92%;
}
.avatar {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #2160a8, #16bcfb); font-weight: 700; font-size: 18px;
  box-shadow: 0 0 0 3px rgba(240, 56, 75, .8);
}
.stream-preview__name { font-weight: 600; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-preview__meta { display: inline-flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 12.5px; flex-wrap: wrap; justify-content: center; }
.stream-preview__meta .icon { width: 14px; height: 14px; }
.dot-sep { opacity: .5; }
.stream-preview__join { margin-top: 6px; }
.stream-preview__status { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
.stream-preview__error { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
.stream-preview__error__text { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-size: 13px; }
.video-stream.small .avatar { width: 30px; height: 30px; font-size: 12px; }
.video-stream.small .stream-preview__meta { display: none; }

/* ----------------------------------------------------------- side panel */

.side-panel {
  width: 0; flex: none; min-height: 0; overflow: hidden; background: var(--panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width .2s ease;
}
.side-panel.open { width: 360px; }
.panel-header { display: flex; align-items: flex-start; gap: 8px; padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.panel-header h3 { font-size: 15px; }
.panel-header .muted { font-size: 12.5px; max-width: 280px; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 360px; }

.viewer-section h4 {
  display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim); margin-bottom: 6px;
}
.viewer-section .count { background: var(--panel-3); color: var(--text); border-radius: 9px; padding: 0 7px; font-size: 11px; }
.viewer-section p.muted { font-size: 13px; padding: 4px 2px; }
.viewer-row { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 6px; border-radius: var(--radius-sm); }
.viewer-row:hover { background: var(--panel-2); }
.viewer-row > .icon { width: 16px; height: 16px; color: var(--text-dim); }
.state-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.state-dot.ok { background: var(--online); }
.state-dot.pending { background: var(--warn); }
.state-dot.bad { background: var(--danger); }

.issues { display: flex; flex-direction: column; gap: 4px; }
.issue { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: var(--radius-sm); }
.issue .icon { width: 16px; height: 16px; }
.issue.ok { color: var(--online); background: rgba(19, 247, 141, .07); }
.issue.minor { color: var(--warn); background: rgba(245, 166, 35, .09); }
.issue.major { color: var(--danger); background: rgba(240, 56, 75, .1); }
.graph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.graph-card { background: var(--bg-contrast); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; }
.graph-card.minor { border-color: rgba(245, 166, 35, .5); }
.graph-card.major { border-color: rgba(240, 56, 75, .6); }
.graph-head { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.graph-value { color: var(--text); font-variant-numeric: tabular-nums; }
.graph { display: block; width: 100%; height: 48px; margin-top: 4px; }
.details { display: flex; flex-direction: column; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 2px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.detail-row span:first-child { color: var(--text-dim); }
.detail-row .value { text-align: right; font-variant-numeric: tabular-nums; word-break: break-all; }
.detail-row.minor .value { color: var(--warn); }
.detail-row.major .value { color: var(--danger); }

/* ----------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(4, 6, 10, .7);
  display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px);
}
.modal {
  width: min(980px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow);
}
.modal-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-header > .icon { color: var(--attention); }
.modal-header h2 { font-size: 16px; }
.modal-footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.setup-stream__body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0; overflow-y: auto; min-height: 0; }
.setup-stream__preview { padding: 16px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--border); }
.setup-stream__settings { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.setup-stream__body:has(> :only-child) { grid-template-columns: 1fr; }
.preview-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: #05070b; border: 1px solid var(--border);
}
.setup-preview-video { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--text-faint); }
.preview-caption { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.preview-caption .icon { width: 15px; height: 15px; color: var(--online); }
.source-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.source-pick p { font-size: 12.5px; }
.source-list { display: flex; flex-direction: column; gap: 4px; }
.source-item {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-contrast); cursor: pointer; text-align: left;
}
.source-item:hover { border-color: var(--border-strong); }
.source-item.active { border-color: var(--accent); background: var(--accent-soft); }
.source-empty { color: var(--text-dim); font-size: 13px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.expander {
  display: flex; align-items: center; gap: 6px; border: none; background: transparent; padding: 4px 0;
  color: var(--text-dim); cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.expander .icon { transition: transform .15s; transform: rotate(-90deg); width: 16px; height: 16px; }
.expander.open .icon { transform: none; }
.expander:hover { color: var(--text); }
.advanced { display: flex; flex-direction: column; gap: 14px; padding-left: 4px; }

/* ---------------------------------------------------------------- toasts */

.toasts { position: fixed; top: 54px; right: 14px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 28px)); }
.toast {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 4px 10px; padding: 12px;
  background: var(--panel-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow); animation: slidein .2s ease;
}
.toast > .icon { color: var(--accent); margin-top: 1px; }
.toast.error { border-left-color: var(--danger); }
.toast.error > .icon { color: var(--danger); }
.toast.request { border-left-color: var(--warn); }
.toast.request > .icon { color: var(--warn); }
.toast-text { font-size: 13.5px; padding-top: 1px; }
.toast-actions { grid-column: 2 / 4; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.toast-actions .btn.danger { color: var(--danger); }
.toast-close { width: 22px; height: 22px; }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }

@media (max-width: 860px) {
  .sidebar { width: 220px; }
  .setup-stream__body { grid-template-columns: 1fr; }
  .setup-stream__preview { border-right: none; border-bottom: 1px solid var(--border); }
  .side-panel.open { position: fixed; right: 0; top: 44px; bottom: 0; z-index: 30; width: min(360px, 100vw); }
  .panel-body { min-width: 0; }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
}
