/* =====================================================================
   Modo Connect — identidade Modo
   Base: design system de referência (tipografia SF Pro, pílulas, vidro fosco, sem sombras decorativas).
   Cores da marca: Azul-noite #03072B · Laranja #FF8200 · Grafite #2C3441
   Complementares (geradas para contraste e estados): ver tokens abaixo.
   ===================================================================== */
:root {
  /* Marca */
  --navy: #03072B;          /* azul-noite: tinta principal, barra lateral escura, palco das chamadas */
  --navy-2: #0B1140;        /* um passo mais claro (blocos sobre o azul-noite) */
  --navy-3: #161D52;        /* hover sobre azul-noite */
  --orange: #FF8200;        /* laranja: única cor de ação */
  --orange-press: #E06F00;  /* laranja pressionado */
  --orange-text: #B85A00;   /* laranja para texto/links em fundo claro (contraste AA 4.6:1) */
  --orange-bright: #FFA347; /* laranja para texto/links em fundo escuro */
  --orange-soft: #FFF1E3;   /* fundo suave de destaque (menções, seleção) */
  --orange-focus: #FF9A33;  /* anel de foco */
  --slate: #2C3441;         /* grafite: blocos escuros, botões da chamada */
  --slate-2: #3A4352;
  --slate-3: #4A5466;

  /* Estados (complementares) */
  --success: #30C46B;
  --warning: #FFC400;
  --danger: #FF3B30;

  /* Tema claro (padrão) */
  --canvas: #FFFFFF;
  --parchment: #F5F5F7;
  --pearl: #FAFAFC;
  --fill: #EEF0F4;
  --hover: #E8EAF0;
  --selected: #E1E4ED;
  --hairline: #E3E5EA;
  --ink: #03072B;
  --body: #1C2235;
  --muted: #5B6475;
  --faint: #8A93A3;
  --accent: var(--orange);
  --on-accent: var(--navy);
  --accent-text: var(--orange-text);
  --accent-soft: var(--orange-soft);
  --frost: rgba(255, 255, 255, .82);
  --frost-strong: rgba(250, 250, 252, .92);
  --scrim: rgba(3, 7, 43, .45);
  --chip: #D9DCE4;

  --st-online: var(--success); --st-idle: var(--warning); --st-dnd: var(--danger); --st-off: #8A93A3;

  /* Tipografia */
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-size: 15px;                            /* interface */
  --msg-size: calc(var(--font-size) + 2px);     /* corpo das mensagens: 17px no padrão */

  /* Formas */
  --r-xs: 5px; --r-sm: 8px; --r-md: 11px; --r-lg: 18px; --pill: 9999px;
  --msg-pad: 2px; --group-gap: 16px;
  --blur: saturate(180%) blur(20px);
  color-scheme: light;
}

/* Modo escuro (único tema do Modo Connect): azul-noite + grafite */
:root[data-theme="dark"] {
  --canvas: #12172B;       /* área principal */
  --parchment: #1A2036;    /* barra lateral, painéis */
  --pearl: #222943;
  --fill: #262E48;         /* campos, fundos de botão */
  --hover: #2A3350;
  --selected: #323C5D;
  --hairline: #29314B;
  --ink: #FFFFFF;
  --body: #E6E9F2;
  --muted: #A3ABC2;
  --faint: #6E7896;
  --accent-text: var(--orange-bright);
  --accent-soft: rgba(255, 130, 0, .15);
  --frost: rgba(18, 23, 43, .82);
  --frost-strong: rgba(26, 32, 54, .94);
  --scrim: rgba(1, 3, 20, .62);
  --chip: #3A4466;
  --st-off: #6E7896;
  color-scheme: dark;
}

/* Ícones de interface (traço simples, cor do texto) */
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
[data-ico] { display: inline-block; width: 1.15em; height: 1.15em; }
.icon-btn .ico { width: 19px; height: 19px; }
.rail-btn .ico { width: 24px; height: 24px; }
.ctl .ico { width: 19px; height: 19px; }
.vs-btn .ico { width: 18px; height: 18px; }
.call-btn .ico { width: 24px; height: 24px; }
.channel .ic .ico, .ic .ico { width: 18px; height: 18px; }
.topbar .hash .ico { width: 21px; height: 21px; }
.tile .label .ico { width: 14px; height: 14px; margin-left: 4px; }
.tile .label .ico:first-child { margin: 0 4px 0 0; }
.voice-members .badges .ico, .room-icons .ico { width: 13px; height: 13px; }
.room-icons { display: inline-flex; gap: 4px; color: var(--muted); }
.member-sub .ico { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.intro-ic .ico { width: 32px; height: 32px; }
.file-ic .ico { width: 28px; height: 28px; color: var(--orange); }
.attach-chip .file-ic .ico { width: 24px; height: 24px; }
.sw-ic .ico, .mention-at .ico { width: 15px; height: 15px; }
.set-nav-item .ico { width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px; }
.type-opt .type-ico { width: 22px; height: 22px; color: var(--orange); margin-bottom: 4px; }
.ws-caret .ico { width: 16px; height: 16px; }
.btn .ico { width: 17px; height: 17px; }
.pin-tag .ico { width: 12px; height: 12px; margin-right: 3px; }
.thread-link .ico { width: 16px; height: 16px; color: var(--accent-text); }
.free-chip .ico, .room-name .ico { width: 15px; height: 15px; margin-right: 6px; color: var(--muted); }
.st-emoji .ico { width: 22px; height: 22px; color: var(--muted); }
.set-close .ico { width: 24px; height: 24px; }
.ev-mi { display: inline-flex; align-items: center; gap: 5px; }
.ev-mi .ico { width: 15px; height: 15px; }
.modal h2 .ico { width: 20px; height: 20px; }
.tiny-lock .ico { width: 12px; height: 12px; }
.ico.sys-ic { width: 16px; height: 16px; color: var(--orange); margin-right: 4px; }

/* Nomes nos vídeos: etiqueta compacta. Nas miniaturas (quando alguém apresenta) some e volta ao passar o mouse ou quando a pessoa fala. */
.tile .label { left: 8px; bottom: 8px; padding: 2px 8px; font-size: 12px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(3, 7, 43, .55); transition: opacity .2s; }
.stage.on + .grid .tile .label { opacity: 0; bottom: 6px; left: 6px; font-size: 11px; padding: 1px 7px; }
.stage.on + .grid .tile:hover .label, .stage.on + .grid .tile.speaking .label { opacity: 1; }
.stage.on + .grid .tile .avatar { width: 48px; height: 48px; font-size: 18px; }

/* Sala de espera */
.afk-banner { display: flex; align-items: center; gap: 14px; margin: 14px 14px 0; padding: 12px 16px; border-radius: var(--r-md); background: rgba(255, 130, 0, .14); color: #fff; }
.afk-banner .ico { width: 26px; height: 26px; color: var(--orange); }
.afk-banner div { display: flex; flex-direction: column; }
.afk-banner span { font-size: 13px; color: rgba(255, 255, 255, .7); }
.call-btn.locked, .vs-btn.locked, .ctl.locked { opacity: .35; cursor: not-allowed; }
.ctx-sub { max-height: 60vh; overflow-y: auto; }

/* Aceno de boas-vindas */
.wave-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; flex-wrap: wrap; }
.wave-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--fill); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 4px 16px 4px 6px; color: var(--ink); font-size: 14px; transition: transform .12s, border-color .15s; }
.wave-btn:hover:not(:disabled) { border-color: var(--orange); }
.wave-btn:active:not(:disabled) { transform: scale(.95); }
.wave-btn:disabled { cursor: default; opacity: .75; }
.wave-btn.done { color: var(--muted); }
.wave-card { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.wave-text { font-size: var(--msg-size); color: var(--body); }
.robot { display: inline-block; width: 64px; height: 64px; flex: none; }
.robot.small { width: 30px; height: 30px; }
.robot svg { width: 100%; height: 100%; overflow: visible; }
.robot .r-arm { transform-box: view-box; transform-origin: 75px 72px; animation: robot-wave 0.55s ease-in-out infinite alternate; }
.robot .r-eyes { transform-box: fill-box; transform-origin: center; animation: robot-blink 3.6s infinite; }
.robot .r-light { animation: robot-light 1.6s ease-in-out infinite; }
.wave-btn .robot .r-arm { animation-play-state: paused; }
.wave-btn:hover .robot .r-arm, .wave-card .robot .r-arm { animation-play-state: running; }
@keyframes robot-wave { from { transform: rotate(-18deg); } to { transform: rotate(22deg); } }
@keyframes robot-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes robot-light { 50% { opacity: .35; } }

/* Carregamento: o "O" da Modo girando */
.modo-loader { width: 30px; height: 30px; object-fit: contain; animation: modo-spin 1.1s linear infinite; }
.modo-loader.big { width: 72px; height: 72px; }
.modo-loader.small { width: 22px; height: 22px; margin: 0 6px; }
.modo-loader.center { display: block; margin: 48px auto; }
@keyframes modo-spin { to { transform: rotate(360deg); } }
.boot-loader { position: fixed; inset: 0; z-index: 200; background: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: rgba(255, 255, 255, .6); font-size: 14px; }
.call-btn.loading { opacity: .6; pointer-events: none; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .35; } }

/* Logos */
.login-logo { width: 200px; max-width: 70%; height: auto; display: block; margin: 4px 0 2px; }
.login-ws { font-size: 17px !important; font-weight: 400 !important; color: var(--muted) !important; letter-spacing: -0.01em !important; margin-top: -4px !important; }
.ws-icon.brand-default img { width: 60%; height: 60%; object-fit: contain; }
.brand-mark img { width: 62%; height: 62%; object-fit: contain; }
:root[data-density="compact"] { --msg-pad: 0px; --group-gap: 8px; }
:root[data-density="spacious"] { --msg-pad: 5px; --group-gap: 24px; }
:root.high-contrast { --muted: #2F3747; --faint: #4A5466; --hairline: #B9BFCB; }
:root.high-contrast[data-theme="dark"] { --muted: #D3D8E2; --faint: #B4BBC8; --hairline: #6B7588; }
:root.reduced-motion *, :root.reduced-motion *::before, :root.reduced-motion *::after { transition: none !important; animation: none !important; }
:root.underline-links a { text-decoration: underline; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--canvas); color: var(--body);
  font: 400 var(--font-size)/1.47 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; letter-spacing: inherit; }
button:disabled { cursor: default; opacity: .55; }
input, textarea, select { font: inherit; color: var(--ink); letter-spacing: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); font-weight: 600; letter-spacing: -0.02em; }
[hidden] { display: none !important; }
code { background: var(--fill); padding: 1px 5px; border-radius: var(--r-xs); font-size: .88em; }
kbd { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xs); padding: 1px 7px; font-size: 12px; font-family: inherit; white-space: nowrap; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.clickable { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange-focus); outline-offset: 2px; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--chip); border-radius: var(--pill); border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Emojis 3D */
img.emoji { width: 1.3em; height: 1.3em; vertical-align: -0.28em; margin: 0 .04em; object-fit: contain; }
.body.jumbo img.emoji { width: 48px; height: 48px; margin: 2px 2px 0 0; vertical-align: middle; }

/* Micro-interação do sistema: tudo que é clicável "afunda" levemente */
.btn, .icon-btn, .call-btn, .rail-btn, .ws-icon, .vs-btn, .ctl, .reaction, .tag-chip, .free-chip, .poll-opt, .tab, .composer-btn { transition: transform .12s ease, background-color .15s ease, color .15s ease, border-color .15s ease; }
.btn:active:not(:disabled), .icon-btn:active, .call-btn:active, .rail-btn:active, .ws-icon:active, .vs-btn:active, .ctl:active, .reaction:active, .tag-chip:active, .free-chip:active, .poll-opt:active:not(:disabled), .tab:active { transform: scale(.95); }

/* ======================= Botões e campos ======================= */
.btn { border: 0; border-radius: var(--pill); padding: 9px 20px; font-size: 15px; font-weight: 400; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; justify-content: center; text-decoration: none !important; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--orange-press); }
.btn.ghost { background: transparent; color: var(--accent-text); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.ghost-solid { background: var(--pearl); color: var(--ink); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn.ghost-solid:hover { background: var(--fill); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 17px; line-height: 1; padding: 6px; border-radius: var(--r-sm); flex: none; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--ink); background: var(--hover); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.text-btn { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); font-size: 14px; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.error { color: var(--danger); margin: 0; font-size: 14px; }

/* ======================= Modais ======================= */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(6px); }
.modal {
  background: var(--canvas); border-radius: var(--r-lg); padding: 28px; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--hairline);
}
.modal.wide { width: min(640px, 100%); }
.modal.small-modal { width: min(420px, 100%); }
.modal.small-modal p { white-space: pre-wrap; margin: 0; color: var(--body); }
.modal h1 { margin: 0; font-size: 28px; line-height: 1.14; }
.modal h2 { margin: 0; font-size: 21px; line-height: 1.19; }
.modal label, .set-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; }
.modal input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=color]), .modal select, .modal textarea,
.set-body input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=color]), .set-body select, .set-body textarea {
  background: var(--fill); border: 1px solid transparent; border-radius: var(--r-md); padding: 10px 14px; outline: none; font-size: 16px; font-weight: 400; width: 100%; color: var(--ink);
}
.modal input:focus, .modal select:focus, .modal textarea:focus, .set-body input:focus, .set-body select:focus, .set-body textarea:focus { border-color: var(--orange); background: var(--canvas); }
.modal textarea, .set-body textarea { resize: vertical; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--orange); }
.modal label.check, .set-check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink); font-weight: 400; cursor: pointer; }
.set-check { display: flex; padding: 6px 0; }
.set-check span { display: flex; flex-direction: column; }
.set-check b { font-weight: 600; }
.set-check small { color: var(--muted); font-size: 13px; }
.set-check input, .modal .check input { margin-top: 4px; }
.field-hint { font-weight: 400; color: var(--faint); font-size: 13px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.brand-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--orange); color: var(--navy); display: grid; place-items: center; font: 700 26px/1 var(--font-display); letter-spacing: -0.03em; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }

.login-back { background: var(--navy) url('/brand/fundo-camera.webp') center / cover no-repeat; backdrop-filter: none; }
.login-back::before { content: ""; position: absolute; inset: 0; background: rgba(3, 7, 43, .78); }
.login-box { position: relative; width: min(440px, 100%); padding: 36px; gap: 16px; background: var(--frost-strong); backdrop-filter: var(--blur); }
.login-box h1 { font-size: 34px; letter-spacing: -0.03em; }
.login-pane { display: flex; flex-direction: column; gap: 14px; }
.login-pane p { margin: 0; }
.login-pane .btn.primary { padding: 12px 22px; font-size: 17px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; gap: 12px; align-items: center;
  background: rgba(3, 7, 43, .92); color: #fff; padding: 10px 12px 10px 20px; border-radius: var(--pill); max-width: calc(100% - 32px);
  backdrop-filter: var(--blur); font-size: 14px;
}
.toast:not(:has(.btn)) { padding-right: 20px; }

/* Menu de contexto (vidro fosco) */
.ctx-menu { position: fixed; z-index: 95; min-width: 220px; background: var(--frost-strong); backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 6px; }
.ctx-item { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: 0; border-radius: var(--r-sm); padding: 7px 10px; font-size: 14px; color: var(--ink); }
.ctx-item:hover:not(:disabled) { background: var(--orange); color: var(--navy); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger); color: #fff; }
.ctx-check { width: 14px; flex: none; font-size: 12px; }
.ctx-label { flex: 1; }
.ctx-hint { font-size: 11px; opacity: .65; }
.ctx-arrow { opacity: .6; }
.ctx-sep { height: 1px; background: var(--hairline); margin: 5px 4px; }
.ctx-title { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 10px 6px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-sub { display: none; position: absolute; left: calc(100% + 2px); top: -6px; }
.ctx-item.has-sub:hover > .ctx-sub, .ctx-item.has-sub:focus-within > .ctx-sub { display: block; }
.ctx-sub .ctx-item { color: var(--ink); }

/* ======================= Layout ======================= */
#app { display: grid; grid-template-columns: 72px 260px 1fr; height: 100vh; overflow: hidden; }

/* Barra global (azul-noite) */
.rail { background: var(--navy); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-sep { width: 32px; height: 1px; background: rgba(255, 255, 255, .14); }
.rail-btn, .ws-icon { position: relative; width: 48px; height: 48px; border-radius: 16px; border: 0; display: grid; place-items: center; font-size: 22px; background: transparent; color: #fff; }
.rail-btn:hover, .rail-btn.active { background: var(--navy-3); }
.rail-btn img.emoji { width: 26px; height: 26px; margin: 0; vertical-align: middle; }
.ws-icon { background: var(--orange); color: var(--navy); font: 700 17px/1 var(--font-display); letter-spacing: -0.02em; overflow: hidden; }
.ws-icon img { width: 100%; height: 100%; object-fit: cover; }
.ws-icon.active::before, .rail-btn.active::before { content: ""; position: absolute; left: -12px; width: 4px; height: 32px; border-radius: 0 4px 4px 0; background: var(--orange); }
.ws-icon.big { width: 64px; height: 64px; font-size: 24px; border-radius: 18px; }
.rail-badge { position: absolute; right: -3px; bottom: -3px; min-width: 20px; height: 20px; border-radius: var(--pill); background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; border: 3px solid var(--navy); letter-spacing: 0; }

/* Barra lateral (pergaminho) */
.sidebar { background: var(--parchment); display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; overflow: hidden; }
.ws-header { height: 52px; flex: none; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--hairline); }
.ws-menu { flex: 1; display: flex; align-items: center; gap: 8px; background: none; border: 0; border-radius: var(--r-sm); padding: 7px 10px; min-width: 0; }
.ws-menu:hover { background: var(--hover); }
.ws-name { font: 600 17px/1.2 var(--font-display); color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; letter-spacing: -0.02em; }
.ws-caret { color: var(--muted); }
#dm-search { width: 100%; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 7px 14px; font-size: 14px; outline: none; }
#dm-search:focus { border-color: var(--orange); }

.channel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--chip) transparent; }
.cat { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 18px 4px 4px 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.cat:hover { color: var(--ink); }
.cat.static { cursor: default; }
.cat.muted { opacity: .55; }
.cat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat .arrow { display: inline-block; font-size: 9px; margin-left: 5px; transition: transform .15s; opacity: .7; }
.cat.collapsed .arrow { transform: rotate(-90deg); }
.cat .icon-btn { font-size: 17px; padding: 0 5px; }

.channels { list-style: none; margin: 0; padding: 0; }
.channel { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 6px 10px; border-radius: var(--r-sm); color: var(--muted); cursor: pointer; user-select: none; margin: 1px 0; font-size: 15px; }
.channel:hover { background: var(--hover); color: var(--ink); }
.channel.active, .channel.connected { background: var(--selected); color: var(--ink); }
.channel.active .nm, .channel.connected .nm { font-weight: 600; }
.channel.unread { color: var(--ink); font-weight: 600; }
.channel.unread::before { content: ""; position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--orange); }
.channel.muted { opacity: .5; }
.channel.restricted .nm { color: var(--faint); }
.channel .ic { width: 18px; text-align: center; color: var(--faint); flex: none; font-weight: 400; }
.channel .ic img.emoji { width: 17px; height: 17px; margin: 0; vertical-align: -3px; }
.channel.voice.live .ic { color: var(--success); }
.channel .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel .hover-btn { display: none; font-size: 13px; padding: 2px 4px; }
.channel:hover .hover-btn { display: inline-flex; }
.channel .sub { flex-basis: 100%; padding-left: 25px; font-size: 13px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel .sub.edit:hover { color: var(--ink); }
.tiny-lock { font-size: 10px; opacity: .6; }
.thread-row { padding-left: 22px; font-size: 14px; }
.nav-row .office-count { font-size: 12px; color: var(--success); font-weight: 600; }
.live-dot { background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: var(--pill); }
.new-cat { margin: 16px 10px; }
.empty-hint { color: var(--muted); font-size: 14px; padding: 8px 10px; }
.timer { font: 600 12px/1 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; color: var(--success); flex: none; letter-spacing: 0; }
.timer.big { font-size: 13px; }
.limit-badge { display: inline-flex; flex: none; border-radius: var(--pill); overflow: hidden; font: 600 11px/1 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: 0; }
.limit-badge span { padding: 3px 6px; background: var(--fill); color: var(--muted); }
.limit-badge span + span { background: var(--chip); color: var(--ink); }
.limit-badge.full span { background: rgba(255, 59, 48, .18); color: var(--danger); }
.mention-badge { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: var(--pill); min-width: 18px; height: 18px; padding: 0 6px; display: grid; place-items: center; flex: none; letter-spacing: 0; }
.voice-members { list-style: none; margin: 0 0 4px; padding: 0 0 0 26px; }
.voice-members li { display: flex; align-items: center; gap: 8px; padding: 3px 8px; font-size: 14px; color: var(--muted); border-radius: var(--r-sm); }
.voice-members li:hover { color: var(--ink); background: var(--hover); }
.voice-members .avatar { width: 22px; height: 22px; font-size: 10px; }
.voice-members .vm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-members .badges { font-size: 12px; display: flex; gap: 3px; align-items: center; }
.badge-live { background: var(--danger); color: #fff; font-weight: 700; font-size: 9px; padding: 1px 6px; border-radius: var(--pill); }
.dm-row { gap: 10px; padding: 7px 10px; }
.dm-row .av-wrap .avatar, .dm-row .group-av { width: 32px; height: 32px; font-size: 13px; }
.group-av { background: var(--slate) !important; color: #fff; }
.dm-info { flex: 1; min-width: 0; }
.dm-info .nm { display: block; }
.dm-sub { font-size: 13px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Painel "Voz conectada" */
.voice-status { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-top: 1px solid var(--hairline); background: var(--parchment); }
.vs-row { display: flex; align-items: center; justify-content: space-between; }
.vs-info { min-width: 0; }
.vs-title { display: flex; align-items: center; gap: 6px; color: var(--success); font-size: 14px; font-weight: 600; }
.vs-channel { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; text-align: left; }
.vs-channel:hover { text-decoration: underline; color: var(--ink); }
.vs-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vs-btn { background: var(--canvas); border: 0; box-shadow: inset 0 0 0 1px var(--hairline); border-radius: var(--r-sm); padding: 6px; font-size: 15px; }
.vs-btn:hover { background: var(--fill); }
.vs-btn.on { background: var(--orange); box-shadow: none; }
.vs-btn img.emoji { width: 20px; height: 20px; margin: 0; vertical-align: middle; }
.ptt-hint { font-size: 12px; color: var(--muted); text-align: center; }
.quality { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.quality i { width: 3px; background: var(--faint); border-radius: 1px; }
.quality i:nth-child(1) { height: 5px; } .quality i:nth-child(2) { height: 8px; } .quality i:nth-child(3) { height: 12px; }
.quality.good i { background: var(--success); }
.quality.ok i:nth-child(-n+2) { background: var(--warning); }
.quality.bad i:nth-child(1) { background: var(--danger); }

.user-panel { flex: none; display: flex; align-items: center; gap: 2px; padding: 8px; background: var(--fill); }
.me-info { flex: 1; min-width: 0; padding-left: 6px; }
.me-name { font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl { background: none; border: 0; border-radius: var(--r-sm); padding: 5px; font-size: 15px; display: grid; place-items: center; }
.ctl:hover { background: var(--hover); }
.ctl.off { background: rgba(255, 59, 48, .14); }
.ctl img.emoji { width: 19px; height: 19px; margin: 0; vertical-align: middle; }

/* Avatares e status */
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--navy); overflow: hidden; transition: box-shadow .15s; letter-spacing: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 80px; height: 80px; font-size: 30px; }
.avatar.speaking { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--success); }
.av-wrap { position: relative; flex: none; display: inline-block; line-height: 0; }
.av-wrap .dot { position: absolute; right: -2px; bottom: -2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--parchment); box-sizing: content-box; display: inline-block; background: var(--st-off); }
.dot.online { background: var(--st-online); }
.dot.idle { background: var(--st-idle); }
.dot.dnd { background: var(--st-dnd); }
.dot.invisible, .dot.offline { background: var(--parchment); box-shadow: inset 0 0 0 3px var(--st-off); }
.user-panel .dot { border-color: var(--fill); }

/* ======================= Área principal ======================= */
.main { background: var(--canvas); min-width: 0; display: flex; position: relative; }
.view { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; position: relative; }
.view.empty { display: grid; place-items: center; color: var(--muted); }
/* Barra de canal: vidro fosco, como a sub-navegação da referência */
.topbar {
  position: relative; z-index: 5; height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--hairline); min-width: 0; background: var(--frost); backdrop-filter: var(--blur);
}
.topbar .hash { color: var(--faint); font-size: 20px; flex: none; }
.topbar .hash img.emoji { width: 20px; height: 20px; margin: 0; vertical-align: middle; }
.tv-title, #vv-title { font: 600 17px/1.2 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32%; letter-spacing: -0.02em; }
.tv-topic { font-weight: 400; font-size: 14px; color: var(--muted); border-left: 1px solid var(--hairline); padding-left: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.tv-topic:empty { display: none; }
.topbar-actions { margin-left: auto; display: flex; gap: 2px; align-items: center; flex: none; }
.topbar .btn-members.on { color: var(--ink); background: var(--selected); }
.topbar-sub { font-size: 14px; font-weight: 400; color: var(--muted); }
.search-input { width: 160px; background: var(--fill); border: 1px solid transparent; border-radius: var(--pill); padding: 6px 14px; font-size: 14px; outline: none; margin-left: 6px; transition: width .2s, background .15s; }
.search-input:focus { width: 260px; background: var(--canvas); border-color: var(--orange); }
.status-btn { background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 400; padding: 3px 8px; border-radius: var(--r-sm); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-btn:hover { background: var(--hover); color: var(--ink); }
#voice-view .topbar .timer { margin-left: auto; }

/* Mensagens */
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; }
.channel-intro { padding: 32px 20px 12px; }
.channel-intro h3 { margin: 10px 0 4px; font-size: 28px; line-height: 1.14; letter-spacing: -0.03em; }
.channel-intro p { margin: 0; font-size: 17px; }
.intro-ic { width: 68px; height: 68px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 32px; color: var(--muted); }
.intro-ic img.emoji { width: 36px; height: 36px; margin: 0; }
.msg { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); padding: var(--msg-pad) 20px; }
.msg:hover { background: var(--pearl); }
:root[data-theme="dark"] .msg:hover { background: rgba(255, 255, 255, .03); }
.msg.head { margin-top: var(--group-gap); }
.msg .avatar { width: 40px; height: 40px; margin-top: 2px; font-size: 15px; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; }
.msg .author { font-weight: 600; font-size: 15px; color: var(--ink); }
.msg .author.clickable:hover { text-decoration: underline; }
.msg .time { font-size: 12px; color: var(--faint); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--msg-size); line-height: 1.47; letter-spacing: -0.022em; color: var(--body); }
.msg .side-time { font-size: 11px; color: transparent; padding-top: 5px; text-align: center; }
.msg:hover .side-time { color: var(--faint); }
.msg.mentioned { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--orange); }
.msg.mentioned:hover { background: var(--accent-soft); }
.msg.flash { animation: flash 2s ease-out; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.msg.system { grid-template-columns: 1fr; color: var(--muted); padding: 6px 20px 6px 78px; margin-top: 10px; }
.msg.system .body { font-size: 15px; color: var(--muted); }
.pin-tag { font-size: 12px; color: var(--muted); }
.edited { font-size: 12px; color: var(--faint); }
.day-sep { display: flex; align-items: center; gap: 10px; margin: 22px 20px 6px; color: var(--faint); font-size: 12px; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.new-sep { display: flex; align-items: center; gap: 8px; margin: 12px 20px 0; color: var(--orange-text); font-size: 12px; font-weight: 700; }
:root[data-theme="dark"] .new-sep { color: var(--orange-bright); }
.new-sep::before { content: ""; flex: 1; height: 1px; background: var(--orange); }

.msg-actions { position: absolute; right: 20px; top: -18px; display: none; gap: 1px; background: var(--frost-strong); backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 3px; z-index: 2; }
.msg:hover .msg-actions { display: flex; }
.msg-actions .icon-btn { font-size: 16px; padding: 4px 6px; }
.msg-actions img.emoji { width: 19px; height: 19px; margin: 0; vertical-align: middle; }

.reply-ref { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--muted); padding-left: 20px; cursor: pointer; margin-bottom: 2px; }
.reply-ref:hover .reply-text { color: var(--ink); }
.reply-arrow { color: var(--faint); }
.reply-author { font-weight: 600; flex: none; }
.reply-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--pill); background: var(--fill); border: 1px solid transparent; font-size: 14px; }
.reaction img.emoji { width: 18px; height: 18px; margin: 0; vertical-align: middle; }
.reaction .count { font-size: 13px; color: var(--muted); font-weight: 600; }
.reaction.mine { border-color: var(--orange); background: var(--accent-soft); }
.reaction.mine .count { color: var(--accent-text); }
.reaction:hover { border-color: var(--chip); }
.msg .reaction.add { opacity: 0; font-size: 14px; color: var(--muted); }
.msg:hover .reaction.add { opacity: 1; }

/* Markdown */
.body em { font-style: italic; }
.body strong { font-weight: 600; color: var(--ink); }
.md-h1 { font: 600 1.6em/1.1 var(--font-display); color: var(--ink); margin: 6px 0; letter-spacing: -0.03em; }
.md-h2 { font: 600 1.3em/1.15 var(--font-display); color: var(--ink); margin: 5px 0; letter-spacing: -0.02em; }
.md-h3 { font: 600 1.1em/1.2 var(--font-display); color: var(--ink); margin: 3px 0; }
.md-quote { border-left: 3px solid var(--chip); padding-left: 12px; color: var(--muted); }
.md-li { display: flex; gap: 7px; padding-left: 6px; }
.md-li > span { color: var(--faint); flex: none; }
.md-code { background: var(--parchment); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 10px 12px; margin: 5px 0; white-space: pre-wrap; font-size: 13px; overflow-x: auto; letter-spacing: 0; }
.md-code code { background: none; padding: 0; }
.spoiler { background: var(--chip); color: transparent; border-radius: var(--r-xs); cursor: pointer; padding: 0 3px; }
.spoiler.revealed { background: var(--fill); color: inherit; cursor: auto; }
.mention { background: var(--accent-soft); color: var(--accent-text); border-radius: var(--r-xs); padding: 0 4px; font-weight: 600; cursor: pointer; }
.mention.me { background: var(--orange); color: var(--navy); }

/* Anexos, prévias, encaminhadas, enquetes, tópicos */
.attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 560px; }
.img-grid { display: grid; gap: 4px; border-radius: var(--r-md); overflow: hidden; }
.img-grid.n1 { grid-template-columns: 1fr; max-width: 420px; }
.img-grid.n2, .img-grid.n3, .img-grid.n4 { grid-template-columns: 1fr 1fr; }
.img-grid img { width: 100%; height: 100%; max-height: 320px; object-fit: cover; cursor: zoom-in; background: var(--fill); display: block; }
.img-grid.n1 img { object-fit: contain; max-height: 360px; width: auto; max-width: 100%; border-radius: var(--r-md); }
.file-card { display: flex; align-items: center; gap: 12px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 10px 14px; text-decoration: none !important; color: var(--ink); max-width: 420px; }
.file-card:hover { border-color: var(--orange); }
.file-ic { font-size: 26px; flex: none; }
.file-ic img.emoji { width: 30px; height: 30px; margin: 0; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-size { font-size: 12px; color: var(--muted); }
.file-dl { color: var(--accent-text); font-size: 14px; font-weight: 600; }
.att-video { max-width: 480px; max-height: 320px; border-radius: var(--r-md); background: #000; }
.embed { display: flex; gap: 12px; background: var(--parchment); border-left: 3px solid var(--orange); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 6px; max-width: 520px; }
.embed-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.embed-site { font-size: 12px; color: var(--muted); }
.embed-title { font-weight: 600; color: var(--accent-text); }
.embed-desc { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.embed-img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.forwarded { border-left: 3px solid var(--chip); padding: 2px 0 2px 12px; margin-top: 4px; }
.fwd-head { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.fwd-preview { background: var(--parchment); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; color: var(--muted); }
.thread-link { display: inline-flex; align-items: center; gap: 6px; background: var(--parchment); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 5px 14px; margin-top: 5px; font-size: 14px; color: var(--ink); }
.thread-link:hover { border-color: var(--orange); }
.thread-link b { font-weight: 600; }
.poll { background: var(--parchment); border-radius: var(--r-lg); padding: 16px; margin-top: 6px; max-width: 460px; display: flex; flex-direction: column; gap: 7px; }
.poll-q { font: 600 17px/1.24 var(--font-display); color: var(--ink); }
.poll-hint, .poll-foot { font-size: 13px; color: var(--muted); }
.poll-opt { position: relative; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--hairline); background: var(--canvas); border-radius: var(--pill); padding: 9px 16px; overflow: hidden; font-size: 15px; }
.poll-opt:hover:not(:disabled) { border-color: var(--orange); }
.poll-opt.mine { border-color: var(--orange); }
.poll-opt.winner { border-color: var(--success); }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); transition: width .3s; }
.poll-check, .poll-text, .poll-pct { position: relative; }
.poll-check { width: 16px; color: var(--accent-text); font-weight: 700; }
.poll-text { flex: 1; color: var(--ink); }
.poll-pct { font-size: 13px; color: var(--muted); }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opt-row { display: flex; gap: 6px; }
.lightbox { position: fixed; inset: 0; z-index: 99; background: rgba(3, 7, 43, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: var(--r-md); }
.lb-bar { display: flex; gap: 12px; align-items: center; color: #fff; font-size: 14px; }

/* Campo de digitação */
.typing { height: 22px; padding: 0 20px; font-size: 13px; color: var(--muted); flex: none; }
.readonly-note { margin: 0 20px 18px; padding: 14px 16px; background: var(--parchment); border-radius: var(--r-md); color: var(--muted); font-size: 14px; }
.composer { position: relative; padding: 0 20px 14px; flex: none; }
.composer-box { display: flex; align-items: flex-end; background: var(--fill); border: 1px solid transparent; border-radius: 22px; padding: 0 6px; transition: border-color .15s, background .15s; }
.composer-box:focus-within { background: var(--canvas); border-color: var(--hairline); }
.composer-box textarea { flex: 1; resize: none; max-height: 200px; border: 0; outline: none; background: none; padding: 11px 6px; font-size: var(--msg-size); line-height: 1.4; color: var(--ink); }
.composer-btn { font-size: 20px; padding: 8px; margin-bottom: 3px; border-radius: 50%; }
.composer-btn img.emoji { width: 22px; height: 22px; margin: 0; vertical-align: middle; }
#btn-plus { color: var(--muted); font-size: 22px; }
.reply-bar { display: flex; align-items: center; justify-content: space-between; background: var(--parchment); border-radius: var(--r-md) var(--r-md) 0 0; padding: 7px 14px; font-size: 14px; color: var(--muted); }
.reply-bar strong { color: var(--ink); font-weight: 600; }
.reply-bar:not([hidden]) ~ .composer-box, .attach-bar:not([hidden]) ~ .composer-box { border-radius: 0 0 22px 22px; }
.attach-bar { display: flex; gap: 8px; overflow-x: auto; padding: 10px; background: var(--parchment); border-radius: var(--r-md) var(--r-md) 0 0; }
.attach-chip { position: relative; display: flex; align-items: center; gap: 8px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 6px; width: 210px; flex: none; }
.attach-chip img:not(.emoji) { width: 48px; height: 48px; object-fit: cover; border-radius: var(--r-sm); }
.attach-chip.uploading { opacity: .7; }
.attach-chip.error { border-color: var(--danger); }
.attach-info { flex: 1; min-width: 0; }
.composer-hint { font-size: 12px; color: var(--faint); padding: 5px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-overlay { position: absolute; inset: 0; z-index: 20; background: rgba(255, 130, 0, .12); display: grid; place-items: center; pointer-events: none; }
.drop-overlay div { background: var(--orange); color: var(--navy); font: 600 21px/1.2 var(--font-display); padding: 22px 32px; border-radius: var(--r-lg); }
.mention-pop { position: absolute; left: 20px; right: 20px; bottom: calc(100% + 6px); z-index: 20; background: var(--frost-strong); backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 6px; }
.mention-title { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 8px 6px; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; }
.mention-item.active, .mention-item:hover { background: var(--hover); }
.mention-item .avatar { width: 24px; height: 24px; font-size: 10px; }
.mention-item .dot { width: 7px; height: 7px; border-width: 2px; }
.mention-item .nm { font-weight: 600; color: var(--ink); }
.mention-item .hint { margin-left: auto; font-size: 12px; color: var(--faint); }
.mention-at { width: 24px; height: 24px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-weight: 600; }

/* Seletor de emoji */
.emoji-pop { position: fixed; z-index: 96; width: 352px; background: var(--frost-strong); backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.emoji-search { background: var(--fill); border: 1px solid transparent; border-radius: var(--pill); padding: 8px 14px; outline: none; font-size: 14px; }
.emoji-search:focus { border-color: var(--orange); background: var(--canvas); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 288px; overflow-y: auto; }
.emoji-grid button { background: none; border: 0; font-size: 22px; border-radius: var(--r-sm); padding: 4px; aspect-ratio: 1; display: grid; place-items: center; }
.emoji-grid button img.emoji { width: 28px; height: 28px; margin: 0; vertical-align: middle; }
.emoji-grid button:hover { background: var(--hover); transform: scale(1.12); }
.emoji-title { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 4px 2px; }

/* Painéis do topo */
.pins-panel { position: absolute; right: 12px; top: 48px; z-index: 30; width: min(420px, calc(100vw - 32px)); max-height: 70vh; background: var(--frost-strong); backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: var(--r-lg); display: flex; flex-direction: column; font-weight: 400; overflow: hidden; }
.pins-panel.wide { width: min(540px, calc(100vw - 32px)); }
.pins-title { padding: 12px 14px; font: 600 15px/1.3 var(--font-display); color: var(--ink); border-bottom: 1px solid var(--hairline); }
.pins-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pins-empty { color: var(--muted); font-size: 14px; padding: 10px; }
.pin-item { position: relative; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 10px 12px; }
.pin-head { display: flex; gap: 8px; align-items: baseline; padding-right: 54px; }
.pin-head .author { font-weight: 600; color: var(--ink); }
.pin-head .time { font-size: 12px; color: var(--faint); }
.pin-item .body { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 120px; overflow: hidden; }
.pin-acts { position: absolute; right: 6px; top: 6px; display: flex; gap: 2px; }
.search-help { display: flex; gap: 10px; align-items: baseline; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: var(--r-sm); }
.search-help b { font-weight: 600; color: var(--ink); }
.search-help:hover { background: var(--hover); }
.thread-item { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 10px 12px; }
.thread-item:hover { border-color: var(--orange); }
.thread-item b { font-weight: 600; color: var(--ink); }
.thread-item .muted { font-size: 13px; }
.old-bar { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 7px 12px; background: var(--accent-soft); color: var(--muted); font-size: 14px; }
.reminder-when { font-size: 13px; font-weight: 600; color: var(--accent-text); margin-bottom: 4px; }
.reminder-when.fired { color: var(--muted); }

/* Caixa de entrada */
.inbox-panel { position: fixed; left: 82px; top: 60px; z-index: 60; width: min(460px, calc(100vw - 96px)); max-height: 75vh; background: var(--frost-strong); backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden; }
.inbox-tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--hairline); }
.tab { background: none; border: 0; border-radius: var(--pill); padding: 6px 14px; font-size: 14px; color: var(--muted); font-weight: 400; }
.tab:hover { background: var(--hover); color: var(--ink); }
.tab.active { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .tab.active { background: var(--orange); color: var(--navy); }
.inbox-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.inbox-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 6px; font-size: 14px; }
.inbox-row { display: flex; align-items: center; gap: 6px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 4px 8px; }
.inbox-ch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: none; border: 0; text-align: left; padding: 6px; overflow: hidden; white-space: nowrap; }
.inbox-ch b { font-weight: 600; color: var(--ink); }
.inbox-ch .ic { color: var(--faint); }

/* ======================= Chamada (palco azul-noite) ======================= */
#voice-view { background: var(--navy); color: #fff; }
#voice-view .topbar { background: rgba(3, 7, 43, .8); border-bottom-color: rgba(255, 255, 255, .08); }
#voice-view .topbar .hash, #voice-view .status-btn { color: rgba(255, 255, 255, .6); }
#voice-view #vv-title { color: #fff; }
#voice-view .status-btn:hover, #voice-view .icon-btn:hover { background: var(--navy-3); color: #fff; }
#voice-view .icon-btn { color: rgba(255, 255, 255, .7); }
.stage { flex: 2; min-height: 0; padding: 14px 14px 0; display: none; }
.stage.on { display: flex; }
.stage .tile { flex: 1; aspect-ratio: auto; }
.grid { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: grid; gap: 12px; align-content: center; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stage.on + .grid { flex: none; max-height: 34vh; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-content: start; }
.tile { position: relative; background: var(--navy-2); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; display: grid; place-items: center; cursor: pointer; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; box-shadow: inset 0 0 0 3px transparent; transition: box-shadow .15s; pointer-events: none; }
.tile.speaking::after { box-shadow: inset 0 0 0 3px var(--success), inset 0 0 18px rgba(48, 196, 107, .35); }
.tile .label, .tile .fs { z-index: 4; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.screen video { object-fit: contain; }
.tile.mirror video { transform: scaleX(-1); }
.tile .avatar { width: 76px; height: 76px; font-size: 28px; }
.tile .label { position: absolute; left: 10px; bottom: 10px; background: rgba(3, 7, 43, .72); backdrop-filter: var(--blur); color: #fff; padding: 3px 10px; border-radius: var(--pill); font-size: 13px; }
.tile .label img.emoji { width: 15px; height: 15px; }
.tile .fs { position: absolute; right: 10px; top: 10px; background: rgba(3, 7, 43, .72); color: #fff; border: 0; border-radius: var(--pill); padding: 4px 9px; opacity: 0; transition: opacity .15s; }
.tile:hover .fs { opacity: 1; }
.call-bar { flex: none; display: flex; justify-content: center; gap: 12px; padding: 14px; flex-wrap: wrap; }
.call-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; background: var(--slate); color: #fff; border: 0; border-radius: var(--r-lg); padding: 10px 14px; font-size: 20px; min-width: 76px; }
.call-btn i { font-style: normal; }
.call-btn img.emoji { width: 26px; height: 26px; margin: 0; vertical-align: middle; }
.call-btn span { font-size: 12px; color: rgba(255, 255, 255, .7); }
.call-btn:hover { background: var(--slate-2); }
.call-btn.on { background: var(--orange); }
.call-btn.on span { color: var(--navy); }
.call-btn.off { background: rgba(255, 59, 48, .35); }
.call-btn.danger { background: var(--danger); }
.call-btn.danger span { color: #fff; }
.vol-pop { position: fixed; z-index: 97; width: 270px; background: var(--frost-strong); backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.vol-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.vol-row { display: flex; align-items: center; gap: 10px; }
.vol-row input { flex: 1; }
.vol-val { font-size: 13px; color: var(--muted); width: 50px; text-align: right; font-weight: 400; }
.ring-box { align-items: center; text-align: center; width: min(360px, 100%); background: var(--navy); color: #fff; border-color: var(--navy-3); }
.ring-box h2 { font-size: 24px; color: #fff; }
.ring-box p { margin: 0; color: rgba(255, 255, 255, .7) !important; }
.ring-avatar .avatar { width: 100px; height: 100px; font-size: 38px; animation: ring 1.2s infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(48, 196, 107, .55); } 50% { box-shadow: 0 0 0 16px rgba(48, 196, 107, 0); } }
.ring-actions { display: flex; gap: 12px; margin-top: 10px; }

/* ======================= Membros ======================= */
.members-panel { width: 248px; flex: none; background: var(--parchment); display: flex; flex-direction: column; height: 100vh; border-left: 1px solid var(--hairline); }
.members-head { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; font: 600 17px/1.2 var(--font-display); color: var(--ink); border-bottom: 1px solid var(--hairline); letter-spacing: -0.02em; }
.members-head span { font: 400 13px var(--font); color: var(--muted); letter-spacing: -0.01em; }
.members-search { margin: 10px 10px 0; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 7px 14px; font-size: 14px; outline: none; }
.members-search:focus { border-color: var(--orange); }
.members-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 8px; }
.member-group { font-size: 13px; font-weight: 600; color: var(--muted); padding: 16px 8px 4px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; }
.member:hover { background: var(--hover); }
.member.dim { opacity: .45; }
.member.dim:hover { opacity: .8; }
.member-info { min-width: 0; }
.member-name { font-size: 15px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-card { position: fixed; z-index: 65; width: 310px; background: var(--canvas); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--hairline); }
.pc-banner { height: 64px; }
.pc-avatar { position: absolute; left: 16px; top: 24px; }
.pc-avatar .avatar { width: 76px; height: 76px; font-size: 28px; border: 5px solid var(--canvas); }
.pc-avatar .dot { width: 14px; height: 14px; right: 3px; bottom: 3px; border-width: 4px; border-color: var(--canvas); }
.pc-body { padding: 48px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.pc-name { font: 600 21px/1.19 var(--font-display); color: var(--ink); letter-spacing: -0.02em; }
.pc-user { font-size: 14px; color: var(--muted); margin-top: -6px; }
.pc-status { font-size: 14px; color: var(--muted); margin-top: -4px; }
.pc-custom, .pc-sec { background: var(--parchment); border-radius: var(--r-md); padding: 9px 12px; font-size: 15px; color: var(--ink); }
.pc-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.pc-room { display: flex; flex-direction: column; }
.pc-cat { font-size: 13px; color: var(--muted); }
.pc-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 2px 9px; font-size: 13px; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.pc-warn { font-size: 14px; color: var(--danger); }
.pc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pc-actions .btn { padding: 7px 14px; font-size: 13px; }

.status-modal { width: min(480px, 100%); }
.st-options { display: flex; flex-direction: column; gap: 4px; }
.modal label.st-opt { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--parchment); color: var(--ink); font-size: 15px; cursor: pointer; font-weight: 400; border: 1px solid transparent; }
.modal label.st-opt:has(input:checked) { border-color: var(--orange); background: var(--accent-soft); }
.st-opt b { font-weight: 600; }
.st-opt .dot { border-color: var(--parchment); }
.st-opt > span:last-child { display: flex; flex-direction: column; }
.st-opt small { font-size: 13px; color: var(--muted); }
.st-custom { display: flex; gap: 6px; align-items: center; }
.st-emoji { background: var(--fill); border: 0; border-radius: var(--r-md); font-size: 20px; padding: 6px 10px; }
.st-emoji img.emoji { width: 24px; height: 24px; margin: 0; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.modal label.pick-row { flex-direction: row; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); font-size: 15px; color: var(--ink); font-weight: 600; cursor: pointer; }
.pick-row:hover { background: var(--hover); }
.pick-row .avatar { width: 28px; height: 28px; font-size: 11px; }
.pick-row .dot { width: 7px; height: 7px; border-width: 2px; }
.pick-row .muted { margin-left: auto; font-size: 13px; font-weight: 400; }

/* Editor de canal */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal label.type-opt { flex-direction: column; align-items: flex-start; gap: 2px; background: var(--parchment); border: 1px solid transparent; border-radius: var(--r-md); padding: 12px; color: var(--ink); font-size: 15px; cursor: pointer; }
.type-opt b { font-weight: 600; }
.type-opt:has(input:checked) { border-color: var(--orange); background: var(--accent-soft); }
.type-opt input { display: none; }
.type-opt small { color: var(--muted); font-weight: 400; font-size: 13px; }
.roles-pick { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ======================= Escritório / fórum / eventos ======================= */
.office-body, .forum-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px 32px; }
.office-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--parchment); border-radius: var(--r-lg); padding: 16px 18px; }
.stat-n { font: 600 40px/1.1 var(--font-display); color: var(--ink); letter-spacing: -0.03em; }
.stat-l { font-size: 14px; color: var(--muted); }
.office-cat { font: 600 21px/1.19 var(--font-display); color: var(--ink); margin: 32px 0 12px; letter-spacing: -0.02em; }
.office-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.room-cat { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: -6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.room-card.mine { border-color: var(--success); box-shadow: inset 0 0 0 1px var(--success); }
.room-head { display: flex; align-items: center; gap: 8px; }
.room-name { font: 600 17px/1.24 var(--font-display); color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.02em; }
.room-status { font-size: 13px; color: var(--muted); margin-top: -6px; }
.room-people { display: flex; flex-direction: column; gap: 4px; }
.room-person { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); cursor: pointer; border-radius: var(--r-sm); padding: 3px 4px; }
.room-person:hover { background: var(--hover); }
.room-person .avatar { width: 26px; height: 26px; font-size: 10px; }
.room-person .dot { width: 7px; height: 7px; border-width: 2px; border-color: var(--canvas); }
.room-icons { margin-left: auto; font-size: 13px; }
.room-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; font-size: 14px; }
.room-you { font-size: 13px; color: var(--success); font-weight: 600; }
.office-people { display: flex; flex-wrap: wrap; gap: 8px; }
.office-person { display: flex; align-items: center; gap: 8px; background: var(--parchment); border-radius: var(--pill); padding: 4px 14px 4px 4px; cursor: pointer; font-size: 15px; color: var(--ink); }
.office-person:hover { background: var(--hover); }
.office-person .avatar { width: 28px; height: 28px; font-size: 11px; }
.office-person .dot { width: 7px; height: 7px; border-width: 2px; }
.office-free { display: flex; flex-wrap: wrap; gap: 8px; }
.free-chip { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 6px 14px; font-size: 14px; color: var(--ink); }
.free-chip:hover { border-color: var(--orange); color: var(--accent-text); }
.office-empty { color: var(--muted); font-size: 15px; padding: 8px 0; }
.office-events { display: flex; flex-direction: column; gap: 8px; }
.office-event { display: flex; align-items: center; gap: 12px; background: var(--parchment); border-radius: var(--r-md); padding: 10px 14px; }
.office-event b { font-weight: 600; color: var(--ink); }
.office-event.live { box-shadow: inset 3px 0 0 var(--danger); }
.office-event .muted { flex: 1; font-size: 14px; }

.forum-tools { display: flex; gap: 10px; }
.forum-tools input { flex: 1; background: var(--fill); border: 1px solid transparent; border-radius: var(--pill); padding: 9px 16px; outline: none; font-size: 15px; }
.forum-tools input:focus { border-color: var(--orange); background: var(--canvas); }
.forum-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.tag-chip { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 4px 13px; font-size: 14px; color: var(--muted); }
.tag-chip:hover { border-color: var(--orange); }
.tag-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .tag-chip.active { background: var(--orange); border-color: var(--orange); color: var(--navy); }
.tag-chip.small { font-size: 12px; padding: 1px 9px; }
.forum-list { display: flex; flex-direction: column; gap: 10px; }
.forum-post { display: flex; gap: 14px; text-align: left; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 16px 18px; color: var(--ink); }
.forum-post:hover { border-color: var(--orange); }
.forum-post.unread .fp-title::after { content: " •"; color: var(--orange); }
.fp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.fp-title { font: 600 19px/1.2 var(--font-display); letter-spacing: -0.02em; }
.fp-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.fp-tags.pick { gap: 6px; }
.fp-excerpt { font-size: 15px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fp-meta { font-size: 13px; color: var(--faint); }
.fp-img { width: 100px; height: 76px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.fp-files { display: flex; flex-wrap: wrap; gap: 6px; }

.cal-box { width: min(1180px, 100%); height: min(860px, calc(100vh - 32px)); padding: 20px 22px; gap: 12px; overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-head h2 { margin-right: 6px; }
.cal-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.cal-period { font: 600 17px/1.2 var(--font-display); color: var(--ink); margin-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: inline-flex; background: var(--fill); border-radius: var(--pill); padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 5px 14px; border-radius: var(--pill); cursor: pointer; }
.seg button.on { background: var(--canvas); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.cal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cal-month { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--hairline); border-left: 1px solid var(--hairline); overflow-y: auto; }
.cal-month .cal-wd { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.cal-day { border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; }
.cal-day:hover { background: var(--pearl); }
.cal-day.other .cal-num { color: var(--faint); opacity: .6; }
.cal-num { font-size: 13px; font-weight: 600; color: var(--body); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; margin: 0 0 2px 2px; }
.cal-day.today .cal-num { background: var(--orange); color: var(--navy); }
.cal-ev, .cal-more { display: flex; gap: 5px; align-items: baseline; border: 0; background: var(--accent-soft); color: var(--ink); font: inherit; font-size: 12px; text-align: left; padding: 2px 6px; border-radius: var(--r-xs); cursor: pointer; min-width: 0; white-space: nowrap; overflow: hidden; }
.cal-ev:hover { filter: brightness(1.15); }
.cal-ev.live, .cal-block.live { box-shadow: inset 3px 0 0 var(--danger); }
.cal-ev-time { color: var(--accent-text); font-weight: 600; flex: none; }
.cal-ev-title { overflow: hidden; text-overflow: ellipsis; }
.cal-more { background: transparent; color: var(--muted); font-weight: 600; }
.cal-week-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--hairline); padding-right: 8px; }
.cal-wh { display: flex; flex-direction: column; align-items: center; padding: 4px 0 8px; }
.cal-wh .cal-wd { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; }
.cal-wnum { font: 600 21px/1.2 var(--font-display); color: var(--ink); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.cal-wh.today .cal-wd { color: var(--orange-bright); }
.cal-wh.today .cal-wnum { background: var(--orange); color: var(--navy); }
.cal-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.cal-week { position: relative; display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); background-image: linear-gradient(var(--hairline) 1px, transparent 1px); background-size: 100% 48px; }
.cal-week > .cal-gutter { position: relative; }
.cal-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--faint); }
.cal-col { position: relative; border-left: 1px solid var(--hairline); cursor: pointer; }
.cal-col:hover { background: rgba(255, 255, 255, .015); }
.cal-col.today { background: rgba(255, 130, 0, .04); }
.cal-block { position: absolute; display: flex; flex-direction: column; gap: 1px; border: 0; border-radius: var(--r-xs); background: var(--orange); color: var(--navy); font: inherit; font-size: 12px; text-align: left; padding: 3px 6px; overflow: hidden; cursor: pointer; z-index: 1; }
.cal-block .cal-ev-time { color: var(--navy); opacity: .75; font-weight: 600; }
.cal-block .cal-ev-title { font-weight: 600; white-space: normal; }
.cal-block.short { flex-direction: row; gap: 5px; align-items: center; white-space: nowrap; }
.cal-block.short .cal-ev-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block.narrow .cal-ev-time { display: none; }
.cal-block:hover { filter: brightness(1.08); z-index: 2; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.modal.event-detail { width: min(520px, 100%); }
.ev-when.live { color: var(--danger); }
.events-list { display: flex; flex-direction: column; gap: 12px; }
.event-card { background: var(--parchment); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 7px; }
.event-card.live { box-shadow: inset 4px 0 0 var(--danger); }
.ev-when { font-size: 14px; font-weight: 600; color: var(--accent-text); }
.event-card.live .ev-when { color: var(--danger); }
.ev-title { font: 600 21px/1.19 var(--font-display); color: var(--ink); letter-spacing: -0.02em; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--muted); }
.ev-desc { font-size: 15px; white-space: pre-wrap; }
.ev-author { font-size: 13px; }
.ev-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ======================= Telas de configurações ======================= */
.fullscreen { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 3fr); background: var(--canvas); }
.set-nav { background: var(--parchment); padding: 44px 14px 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; overflow-y: auto; border-right: 1px solid var(--hairline); }
.set-nav > * { width: 232px; }
.set-nav input { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--pill); padding: 7px 14px; font-size: 14px; outline: none; margin-bottom: 10px; }
.set-nav input:focus { border-color: var(--orange); }
.set-nav-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 12px; }
.set-nav-item { display: block; text-align: left; background: none; border: 0; border-radius: var(--r-sm); padding: 8px 12px; color: var(--body); font-size: 15px; }
.set-nav-item:hover { background: var(--hover); color: var(--ink); }
.set-nav-item.active { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .set-nav-item.active { background: var(--orange); color: var(--navy); }
.set-nav-item.danger { color: var(--danger); margin-top: 14px; }
#settings-nav-list { display: flex; flex-direction: column; gap: 2px; }
.set-body { overflow-y: auto; padding: 44px 48px 64px; }
.set-body > div { max-width: 760px; }
.set-close { position: fixed; right: 30px; top: 38px; z-index: 71; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; color: var(--muted); font-size: 22px; }
.set-close span { font-size: 11px; font-weight: 600; }
.set-close:hover { color: var(--ink); }
.set-section { display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--hairline); }
.set-section h3 { margin: 0; font-size: 28px; line-height: 1.14; letter-spacing: -0.03em; }
.set-section p { margin: 0; }
.set-save { position: sticky; bottom: 0; padding: 14px 0; background: var(--frost); backdrop-filter: var(--blur); }
.icon-row { display: flex; gap: 10px; align-items: center; }
.icon-row input { max-width: 260px; }
.profile-preview { display: flex; gap: 16px; align-items: center; background: var(--parchment); padding: 18px; border-radius: var(--r-lg); }
.profile-preview b { font: 600 21px/1.2 var(--font-display); color: var(--ink); }
.test-row { display: flex; gap: 12px; align-items: center; }
.meter { flex: 1; height: 10px; background: var(--fill); border-radius: var(--pill); overflow: hidden; }
.meter-bar { height: 100%; width: 0; background: var(--success); transition: width .05s; border-radius: var(--pill); }
.shortcut-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; align-items: center; }
.shortcut { display: contents; }
.roles-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.roles-list { display: flex; flex-direction: column; gap: 2px; }
.role-item { display: flex; align-items: center; gap: 8px; text-align: left; background: none; border: 0; border-radius: var(--r-sm); padding: 8px 12px; }
.role-item span:nth-child(2) { flex: 1; color: var(--ink); }
.role-item:hover { background: var(--hover); }
.role-item.active { background: var(--selected); }
.role-form { display: flex; flex-direction: column; gap: 14px; }
.perm-list { display: flex; flex-direction: column; }
.member-table { display: flex; flex-direction: column; gap: 6px; }
.mt-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 160px 36px; gap: 12px; align-items: center; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 10px 12px; }
.mt-row b { font-weight: 600; color: var(--ink); }
.mt-row.disabled { opacity: .5; }
.mt-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.mt-who .muted { font-size: 13px; }
.mt-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.set-body .mt-team { padding: 7px 10px; font-size: 14px; }
.invite-result { display: flex; gap: 8px; align-items: center; }
.invite-row { display: flex; gap: 10px; align-items: center; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 9px 12px; font-size: 14px; }
.invite-row .muted { flex: 1; }
.audit-list { display: flex; flex-direction: column; }
.audit-row { display: flex; gap: 14px; padding: 8px 4px; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.audit-row b { font-weight: 600; color: var(--ink); }
.audit-time { color: var(--faint); font-size: 13px; width: 150px; flex: none; }

/* Ctrl+K */
.switcher-box { width: min(580px, 100%); }
.switcher-box input { font-size: 21px !important; padding: 14px 18px !important; border-radius: var(--pill) !important; }
.sw-list { display: flex; flex-direction: column; gap: 2px; }
.sw-item { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; border-radius: var(--r-sm); padding: 9px 12px; }
.sw-item.active, .sw-item:hover { background: var(--hover); }
.sw-item.active { box-shadow: inset 3px 0 0 var(--orange); }
.sw-ic { width: 24px; text-align: center; }
.sw-label { font-weight: 600; color: var(--ink); }
.sw-sub { margin-left: auto; font-size: 13px; color: var(--muted); }

/* Requisitos */
.req-modal { width: min(640px, 100%); }
.req-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.req-form { display: flex; flex-direction: column; gap: 10px; }
.req-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.modal label.req-attach { flex-direction: row; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: var(--ink); }
.req-shot { position: relative; align-self: flex-start; }
.req-shot img { max-width: 100%; max-height: 220px; border-radius: var(--r-md); border: 1px solid var(--hairline); display: block; }
.req-shot .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--scrim); color: #fff; }
.req-dev-title { margin: 8px 0 0; font-size: 17px; }
.req-img img { display: block; max-width: 100%; max-height: 260px; border-radius: var(--r-sm); margin-top: 6px; border: 1px solid var(--hairline); }
.dev-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.dev-grid b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.req { display: flex; gap: 10px; align-items: flex-start; background: var(--parchment); border-radius: var(--r-md); padding: 11px 12px; }
.req input { margin-top: 4px; }
.req-body { flex: 1; min-width: 0; }
.req-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.req-meta { font-size: 13px; color: var(--faint); margin-top: 2px; }
.req.done .req-text { text-decoration: line-through; color: var(--faint); }
.req-group { font-size: 13px; font-weight: 600; color: var(--accent-text); padding: 12px 2px 2px; }
.req-empty { color: var(--muted); font-size: 15px; padding: 8px 0; }

/* ======================= Responsivo ======================= */
@media (max-width: 1100px) {
  .members-panel { position: fixed; right: 0; top: 0; z-index: 40; }
  .search-input { width: 120px; }
  .search-input:focus { width: 190px; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { flex-direction: row; justify-content: center; padding: 6px; }
  .rail-sep { width: 1px; height: 32px; }
  .rail-btn, .ws-icon { width: 42px; height: 42px; }
  .sidebar { height: 40vh; }
  .view { height: calc(60vh - 54px); }
  .members-panel { height: 100vh; }
  .grid { grid-template-columns: 1fr 1fr; }
  .call-btn { min-width: 0; padding: 8px 10px; }
  .office-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-topic, .composer-hint { display: none; }
  .fullscreen { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .set-nav { padding: 12px; align-items: stretch; flex-direction: row; overflow-x: auto; }
  .set-nav > * { width: auto; }
  #settings-nav-list { flex-direction: row; }
  .set-body { padding: 18px; }
  .roles-layout { grid-template-columns: 1fr; }
  .mt-row { grid-template-columns: 1fr; }
  .inbox-panel { left: 8px; }
  .msg { padding-left: 12px; padding-right: 12px; }
}

/* ======================= Painel do servidor ======================= */
.metrics-screen { position: fixed; inset: 0; z-index: 45; background: var(--canvas); display: flex; flex-direction: column; }
.mx-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--hairline); }
.mx-head h1 { margin: 0 8px 0 0; font: 600 24px/1.2 var(--font-display); color: var(--ink); letter-spacing: -0.02em; }
.mx-head .cal-nav { flex: 1; }
.mx-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 22px; }
.mx-sec h3, .mx-now h2 { margin: 0 0 12px; font: 600 19px/1.2 var(--font-display); color: var(--ink); letter-spacing: -0.01em; }
.mx-now { background: var(--parchment); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.mx-now-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mx-now-head h2 { margin: 0; }
.mx-now-head .muted { font-size: 13px; }
.mx-status { font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: var(--pill); }
.mx-status.ok { background: rgba(48, 196, 107, .18); color: var(--success); }
.mx-status.warn { background: rgba(255, 196, 0, .18); color: var(--warning); }
.mx-status.crit { background: rgba(255, 59, 48, .18); color: var(--danger); }
.mx-active { display: flex; flex-direction: column; gap: 6px; }
.mx-alert { font-size: 14px; padding: 8px 12px; border-radius: var(--r-sm); }
.mx-alert.warn { background: rgba(255, 196, 0, .12); color: var(--warning); }
.mx-alert.crit { background: rgba(255, 59, 48, .14); color: var(--danger); }
.mx-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.mx-bar-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.mx-bar-head b { color: var(--ink); font-size: 16px; }
.mx-track { position: relative; height: 8px; background: var(--fill); border-radius: var(--pill); margin: 6px 0 4px; }
.mx-fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--pill); background: var(--success); transition: width .4s; }
.mx-bar.warn .mx-fill { background: var(--warning); }
.mx-bar.crit .mx-fill { background: var(--danger); }
.mx-bar.none .mx-fill { background: var(--faint); }
.mx-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--warning); opacity: .6; }
.mx-mark.crit { background: var(--danger); }
.mx-bar-sub { font-size: 12px; color: var(--faint); }
.mx-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.mx-count { background: var(--canvas); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; }
.mx-count b { font: 600 26px/1.1 var(--font-display); color: var(--ink); }
.mx-count span { font-size: 12px; color: var(--muted); }
.mx-fold { font-size: 15px; color: var(--body); }
.mx-fold small { display: block; margin-top: 4px; }
.mx-fold b { color: var(--accent-text); }
.mx-fold small { color: var(--faint); font-size: 12px; }
.mx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mx-kpi { background: var(--parchment); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.mx-kpi span { font-size: 12px; color: var(--muted); }
.mx-kpi b { font: 600 22px/1.2 var(--font-display); color: var(--ink); }
.mx-kpi small { font-size: 12px; color: var(--faint); }
.mx-kpi small.up { color: var(--warning); }
.mx-kpi small.down { color: var(--success); }
.mx-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.mx-chart { background: var(--parchment); border-radius: var(--r-lg); padding: 12px 14px; position: relative; }
.mx-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ink); }
.mx-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.mx-legend .lg { display: inline-flex; align-items: center; gap: 4px; }
.mx-legend .lg i { width: 12px; height: 3px; border-radius: 2px; background: currentColor; }
.mx-legend .lg.dash i { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); }
.c1 { color: #FF8200; } .c2 { color: #9DB4FF; } .c3 { color: #7FD1C7; } .c4 { color: #D7C2FF; }
.mx-svg-wrap { position: relative; }
.mx-svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.mx-svg .grid { stroke: var(--hairline); stroke-width: 1; }
.mx-svg .ax { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.mx-svg .ln { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mx-svg .ln.dash { stroke-dasharray: 5 4; stroke-width: 1.6; }
.mx-svg .lim { stroke-width: 1; stroke-dasharray: 3 3; }
.mx-svg .lim.warn { stroke: var(--warning); }
.mx-svg .lim.crit { stroke: var(--danger); }
.mx-svg .lim.link { stroke: var(--muted); stroke-dasharray: none; }
.mx-svg .now { stroke: var(--danger); stroke-width: 1; opacity: .5; }
.mx-svg .cursor { stroke: var(--muted); stroke-width: 1; }
.mx-tip { position: absolute; top: 8px; background: var(--navy); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: var(--r-sm); pointer-events: none; min-width: 130px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.mx-tip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.mx-chart-empty { position: absolute; inset: 40px 0 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; pointer-events: none; }
.mx-forecast { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.mx-fc { background: var(--parchment); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; border-left: 4px solid var(--success); }
.mx-fc.warn { border-left-color: var(--warning); }
.mx-fc.crit { border-left-color: var(--danger); }
.mx-fc.none { border-left-color: var(--faint); }
.mx-fc b { color: var(--ink); }
.mx-fc .btn { align-self: flex-start; }
.mx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mx-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--faint); padding: 6px 8px; border-bottom: 1px solid var(--hairline); }
.mx-table td { padding: 8px; border-bottom: 1px solid var(--hairline); color: var(--body); }
.mx-incidents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mx-inc { display: flex; gap: 12px; font-size: 14px; padding: 7px 10px; border-radius: var(--r-sm); background: var(--parchment); border-left: 3px solid var(--faint); }
.mx-inc.warn { border-left-color: var(--warning); }
.mx-inc.crit { border-left-color: var(--danger); }
.mx-inc-t { color: var(--faint); flex: none; width: 150px; }
.mx-empty { color: var(--faint); font-size: 14px; margin: 0; }
@media (max-width: 700px) { .mx-charts { grid-template-columns: 1fr; } .mx-head { padding: 12px 16px; } .mx-body { padding: 16px; } }
.cal-bday { display: block; width: 100%; border: 0; background: rgba(215, 194, 255, .16); color: var(--ink); font: inherit; font-size: 12px; text-align: left; padding: 2px 6px; border-radius: var(--r-xs); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bday:hover { background: rgba(215, 194, 255, .28); }
.cal-wh .cal-bday { margin-top: 4px; text-align: center; max-width: 100%; }
.bday-preview { display: flex; flex-direction: column; gap: 6px; background: var(--parchment); border-radius: var(--r-md); padding: 12px 14px; }
.bday-msg { font-size: 15px; color: var(--ink); padding-bottom: 6px; }
.bday-list { display: flex; flex-direction: column; gap: 4px; }
.bday-row { display: grid; grid-template-columns: minmax(140px, 1fr) 130px 2fr; gap: 12px; font-size: 14px; padding: 8px 10px; background: var(--parchment); border-radius: var(--r-sm); }
.mx-storage { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; }
.mx-card { background: var(--parchment); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.mx-card b { color: var(--ink); font-size: 15px; }
.mx-card p { margin: 0; }
.mx-card input:not([type=checkbox]) { background: var(--canvas); border: 1px solid var(--hairline); color: var(--ink); border-radius: var(--r-sm); padding: 8px 10px; font: inherit; width: 100%; box-sizing: border-box; }
.mx-row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.mx-inline { display: flex; align-items: center; gap: 8px; color: var(--body); cursor: pointer; }
.mx-err { color: var(--danger); }
.mx-acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.file-card.expired { opacity: .6; cursor: default; }
