/* Ungrid.chat — estilos base. Layout estilo Discord entra na etapa 3. */

:root {
  /* Identidade Ungrid */
  --lime: #c8f135;
  --purple: #b94dff;

  /* Superfícies (tema escuro, do mais fundo pro mais alto) */
  --bg-0: #0e0f12;   /* coluna de servidores */
  --bg-1: #15171c;   /* coluna de canais / membros */
  --bg-2: #1b1e24;   /* área do chat */
  --bg-3: #242831;   /* inputs, hover */
  --line: #2c313b;

  --text: #e8eaee;
  --text-dim: #9aa1ad;
  --text-mute: #6b7280;
  --danger: #ff5c6c;

  --font: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
  --radius: 10px;
}

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

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg-2);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
a { color: var(--lime); }
[hidden] { display: none !important; }

#app { height: 100%; }

.screen { height: 100%; }
.screen-center {
  height: auto;
  min-height: 100%;          /* cresce e rola em telas baixas em vez de cortar o topo */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 16px;
  padding: 16px;
}

/* Marca */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--lime), var(--purple));
}
.brand-name {
  margin: 0;
  font: 400 40px/1 var(--font-display);
  letter-spacing: -0.01em;
}
.brand-name em { color: var(--lime); font-style: italic; }

.boot-status { margin: 0; color: var(--text-dim); text-align: center; max-width: 420px; }
.boot-status.is-error { color: var(--danger); }
.boot-status code {
  background: var(--bg-3); padding: 1px 6px; border-radius: 6px; font-size: 13px;
}

/* Cartão e formulários */
.card {
  width: 100%; max-width: 380px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}

.tabs { display: flex; gap: 4px; background: var(--bg-0); padding: 4px; border-radius: var(--radius); }
.tab {
  flex: 1; border: 0; background: none; padding: 8px; border-radius: 7px;
  color: var(--text-dim); font-weight: 500; cursor: pointer;
}
.tab.is-active { background: var(--bg-3); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.field small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-mute); }
.field input {
  background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; outline: none;
}
.field input:focus { border-color: var(--lime); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.form-msg { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--danger); }
.form-msg.is-ok { color: var(--lime); }

.btn {
  border: 1px solid var(--line); background: var(--bg-3); border-radius: 8px;
  padding: 10px 14px; font-weight: 600; cursor: pointer;
}
.btn:hover { border-color: var(--text-mute); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: #111; }
.btn-primary:hover { border-color: var(--lime); filter: brightness(1.05); }

/* ---------- Layout principal: servidores | canais | chat | membros ---------- */

.layout {
  display: grid;
  grid-template-columns: 72px 240px minmax(0, 1fr) 240px;
  height: 100%;
  overflow: hidden;
}

/* Avatar/ícone com iniciais (cor vem do JS por hash do nome) */
.avatar {
  flex: none;
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 13px; font-weight: 700; color: #111;
  background: var(--purple);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Coluna de servidores */
.rail {
  background: var(--bg-0);
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 12px 0;
  overflow-y: auto;
}
.rail-list { display: flex; flex-direction: column; gap: 8px; }
.rail-sep { width: 32px; height: 2px; background: var(--line); border-radius: 1px; flex: none; }
.rail-list:empty + .rail-sep { display: none; }
.rail-btn {
  position: relative;
  width: 48px; height: 48px; flex: none;
  border: 0; border-radius: 50%;
  background: var(--bg-3); color: var(--text);
  font-weight: 700; font-size: 16px;
  cursor: pointer;
  transition: border-radius .15s, background .15s;
}
.rail-btn:hover, .rail-btn.is-active { border-radius: 16px; }
.rail-btn.is-active { background: var(--lime); color: #111; }
/* Pílula à esquerda do servidor ativo */
.rail-btn::before {
  content: ''; position: absolute; left: -12px; top: 50%;
  width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: var(--text); transform: translateY(-50%);
  transition: height .15s;
}
.rail-btn.has-unread::before { height: 8px; }
.rail-btn:hover::before { height: 20px; }
.rail-btn.is-active::before { height: 40px; }
.rail-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
/* Início (DMs): a marca Ungrid dentro do botão */
.rail-home { display: grid; place-items: center; }
.rail-home .brand-mark { width: 24px; height: 24px; border-radius: 7px; }
.rail-home.is-active { background: var(--bg-3); }
.rail-home.is-active .brand-mark, .rail-home:hover .brand-mark { border-radius: 50%; }
.rail-add { color: var(--lime); font-size: 24px; font-weight: 400; }
.rail-add:hover { background: var(--lime); color: #111; }
.rail-add::before { display: none; }

/* Coluna de canais */
.sidebar {
  background: var(--bg-1);
  display: flex; flex-direction: column;
  min-height: 0;
}
.sidebar-head {
  height: 48px; flex: none;
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.sidebar-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-list { flex: 1; overflow-y: auto; padding: 12px 8px; }
.channel-group {
  margin: 16px 8px 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-mute);
}
.channel-group:first-child { margin-top: 0; }
.channel {
  display: flex; align-items: center; gap: 6px;
  width: 100%; border: 0; background: none; text-align: left;
  padding: 6px 8px; border-radius: 6px;
  color: var(--text-dim); cursor: pointer;
}
.channel:hover { background: var(--bg-3); color: var(--text); }
.channel.is-active { background: var(--bg-3); color: var(--text); }
.channel.is-unread { color: var(--text); font-weight: 600; position: relative; }
/* Bolinha de não lida, colada na borda esquerda da coluna (como no Discord) */
.channel.is-unread::before {
  content: ''; position: absolute; left: -8px; top: 50%;
  width: 8px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0;
  background: var(--lime);
}
.channel.is-voice { cursor: default; }
.channel.is-voice:hover { background: none; color: var(--text-dim); }
.channel-icon { width: 18px; text-align: center; color: var(--text-mute); flex: none; }
.channel-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-panel {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 8px; background: #121418;
}
.user-panel-names { flex: 1; min-width: 0; line-height: 1.2; }
.user-panel-names strong, .user-panel-names small {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-panel-names small { color: var(--text-mute); font-size: 12px; }

.icon-btn {
  flex: none;
  border: 0; background: none; color: var(--text-dim);
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  display: grid; place-items: center; font-size: 16px;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text); }

/* Área do chat */
.chat {
  background: var(--bg-2);
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
}
.chat-head {
  height: 48px; flex: none;
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.chat-hash { color: var(--text-mute); font-size: 20px; }
.chat-title { white-space: nowrap; }
.chat-topic {
  min-width: 0; color: var(--text-mute); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-left: 8px; margin-left: 4px; border-left: 1px solid var(--line);
}
.chat-topic:empty { display: none; }
.messages {
  flex: 1; overflow-y: auto; padding: 16px 0 8px;
  display: flex; flex-direction: column;
  overflow-anchor: none;   /* o scroll ao carregar páginas antigas é ajustado no JS */
}
.composer { flex: none; padding: 0 16px 4px; }   /* a linha do "digitando" (.typing) ocupa o resto */
.composer-box { background: var(--bg-3); border-radius: var(--radius); }
.composer-row { display: flex; align-items: flex-start; gap: 4px; padding: 4px 4px 4px 8px; }
.composer-row .icon-btn { margin-top: 4px; }
.composer textarea {
  flex: 1; display: block; width: 100%; border: 0; outline: none; resize: none;
  background: none;
  padding: 8px 8px; line-height: 1.4; max-height: 200px;
}
.composer textarea:disabled { opacity: .6; }
.composer.is-sending .composer-box { opacity: .7; }

/* Arquivos escolhidos, antes de enviar */
.attach-tray { display: flex; gap: 8px; overflow-x: auto; padding: 10px 10px 4px; }
.tray-item {
  position: relative; flex: none;
  width: 140px; padding: 8px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.tray-item img { width: 100%; height: 84px; object-fit: cover; border-radius: 6px; }
.tray-item .att-file-icon { height: 84px; display: grid; place-items: center; font-size: 36px; }
.tray-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-item small { color: var(--text-mute); font-size: 11px; }
.tray-remove {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: var(--danger); color: #fff; cursor: pointer; line-height: 1;
}

/* Arrastando arquivo por cima do chat */
.chat { position: relative; }
.chat.is-dragging::after {
  content: 'Solte pra anexar'; position: absolute; inset: 8px; z-index: 5;
  display: grid; place-items: center;
  border: 2px dashed var(--lime); border-radius: 14px;
  background: rgba(14, 15, 18, .85); color: var(--lime);
  font: 400 32px var(--font-display);
  pointer-events: none;
}

/* Anexos dentro da mensagem */
.msg-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.att-img {
  display: block; border-radius: 8px; overflow: hidden; background: var(--bg-1);
  max-width: min(400px, 100%);
}
/* Altura fixa: a imagem carregar não empurra a conversa (evita pulo no scroll) */
.att-img img { display: block; height: 220px; max-width: 100%; min-width: 80px; object-fit: contain; }
.att-file {
  display: flex; align-items: center; gap: 10px;
  max-width: min(360px, 100%); padding: 10px 12px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); text-decoration: none;
}
.att-file:hover { border-color: var(--text-mute); }
.att-file-icon { font-size: 24px; flex: none; }
.att-file-info { min-width: 0; display: flex; flex-direction: column; }
.att-file-name { color: var(--lime); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-file small { color: var(--text-mute); font-size: 12px; }

/* Mensagens */
.msg-list { margin-top: auto; }   /* poucas mensagens ficam coladas embaixo, como no Discord */
.msg-loading { padding: 16px; text-align: center; color: var(--text-mute); font-size: 14px; }

.channel-start { padding: 16px 16px 8px; }
.channel-start-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-3); color: var(--lime); font-size: 36px;
}
.channel-start h2 { margin: 12px 0 4px; font: 400 32px/1.1 var(--font-display); }
.channel-start p { margin: 0; color: var(--text-dim); }

.day-sep {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 16px 8px;
  color: var(--text-mute); font-size: 12px; font-weight: 600;
}
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.msg {
  display: flex; gap: 14px;
  padding: 2px 16px; margin-top: 14px;
}
.msg.is-compact { margin-top: 0; }
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg-avatar { width: 40px; height: 40px; font-size: 15px; margin-top: 2px; }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-weight: 600; }
.msg-time { font-size: 12px; color: var(--text-mute); }
.msg-time-side {
  width: 40px; flex: none; text-align: right;
  font-size: 11px; line-height: 22px; color: var(--text-mute);
  visibility: hidden;
}
.msg.is-compact:hover .msg-time-side { visibility: visible; }
.msg-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-edited { font-size: 11px; color: var(--text-mute); }

/* Ferramentas da mensagem (aparecem no hover) */
.msg { position: relative; }
.msg-tools {
  position: absolute; top: -14px; right: 16px; z-index: 2;
  display: none; gap: 2px; padding: 2px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
.msg:hover .msg-tools, .msg-tools:focus-within { display: flex; }
.icon-btn.is-danger:hover { color: var(--danger); }

/* Edição no lugar */
.msg-editor { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 4px; }
.msg-edit {
  width: 100%; resize: none; outline: none; overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--lime); border-radius: 8px;
  padding: 8px 10px; line-height: 1.4;
}
.msg-editor small { color: var(--text-mute); font-size: 12px; }

/* Confirmação de apagar */
.delete-preview {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; max-height: 160px; overflow: auto;
}
.delete-preview strong { display: block; margin-bottom: 2px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { border-color: var(--danger); filter: brightness(1.1); }
.msg-content a { color: var(--lime); }

.empty {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; color: var(--text-dim);
}
.messages > .empty { flex: 1; height: auto; }
.empty h2 { margin: 0; font: 400 32px/1.1 var(--font-display); color: var(--text); }
.empty h2 em { color: var(--lime); }
.empty p { margin: 0; max-width: 360px; }

/* Lista de membros */
.members { background: var(--bg-1); overflow-y: auto; padding: 16px 8px; }
.member {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border-radius: 6px;
  border: 0; background: none; text-align: left; cursor: pointer;
}
.member:hover { background: var(--bg-3); }
.member-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-owner { color: var(--lime); font-size: 12px; }

.member.is-offline { opacity: .45; }
.member.is-offline:hover { opacity: .8; }

/* Bolinha de status sobre o avatar: online, ausente, não perturbe, offline */
.avatar-wrap, .status-btn { position: relative; flex: none; display: inline-flex; }
.status-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 3px solid var(--bg-1); box-sizing: content-box;
}
.status-dot.is-online { background: #3ba55d; }
.status-dot.is-idle { background: #faa61a; }
.status-dot.is-dnd { background: var(--danger); }
.status-dot.is-offline { background: #747f8d; }
.user-panel .status-dot { border-color: #121418; }

/* Seletor de status (clique no avatar do painel) */
.status-btn { border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; }
.status-btn:hover .avatar { filter: brightness(1.1); }
.user-panel { position: relative; }
.status-menu {
  position: absolute; left: 8px; bottom: calc(100% + 6px); z-index: 20; min-width: 190px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--bg-0); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.status-item {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: none; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 6px;
}
.status-item:hover, .status-item.is-active { background: var(--bg-3); }
.status-item .status-dot { position: static; border: 0; width: 10px; height: 10px; }

/* "Fulano está digitando…" embaixo do campo (altura fixa: não empurra a conversa) */
.typing { height: 18px; margin-top: 4px; padding-left: 4px; font-size: 12px; color: var(--text-dim); overflow: hidden; }
.typing strong { color: var(--text); }

/* Tamanhos extras de avatar */
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avatar-xl { width: 80px; height: 80px; font-size: 30px; }

/* Cartão de perfil do membro */
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-name { display: block; font-size: 18px; }
.profile-user { color: var(--text-mute); }

/* Lista de DMs (mesmo visual de .channel) */
.dm-item { gap: 10px; }
.dm-friends { margin-bottom: 8px; }
.dm-friends .channel-icon { font-size: 15px; }

/* Contador (pedidos de amizade) */
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.rail-badge { position: absolute; right: -4px; bottom: -4px; border: 3px solid var(--bg-0); box-sizing: content-box; }

/* Botões menores e de perigo */
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tela "Amigos" (ocupa a área do chat) */
.friends-view { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.friends-tabs {
  position: sticky; top: 0; z-index: 1; background: var(--bg-2);
  display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0;
}
.friends-tab {
  display: flex; align-items: center; gap: 6px;
  border: 0; background: none; color: var(--text-dim);
  padding: 6px 10px; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.friends-tab:hover { background: var(--bg-3); color: var(--text); }
.friends-tab.is-active { background: var(--bg-3); color: var(--text); }
.friends-tab-add { background: var(--lime); color: #111; }
.friends-tab-add:hover, .friends-tab-add.is-active { background: var(--lime); color: #111; filter: brightness(1.05); }
.friends-list .channel-group { margin: 8px 0; }
.friend-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 8px;
}
.friend-row:hover { background: rgba(255, 255, 255, .025); }
.friend-who { flex: 1; min-width: 0; line-height: 1.25; }
.friend-who strong, .friend-who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-who small { color: var(--text-mute); font-size: 13px; }
.friend-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.friend-add { max-width: 520px; display: flex; flex-direction: column; gap: 10px; }
.friend-add h3 { margin: 0; font: 400 26px/1.1 var(--font-display); }
.friend-add input {
  flex: 1; min-width: 0; background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; outline: none;
}
.friend-add input:focus { border-color: var(--lime); }
.dm-empty { margin: 4px 8px; font-size: 13px; color: var(--text-mute); }

/* Início: sem coluna de membros */
.layout.is-home { grid-template-columns: 72px 240px minmax(0, 1fr); }
.layout.is-home .members { display: none; }

/* Modal (<dialog>) */
.modal {
  padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-1); color: var(--text);
  width: min(440px, calc(100vw - 32px));
}
.modal::backdrop { background: rgba(0, 0, 0, .6); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-title { margin: 0; font: 400 28px/1.1 var(--font-display); }
.modal-text { margin: 0; color: var(--text-dim); }
.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal .form-msg:empty { display: none; }
.divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-mute); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.field select {
  background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; outline: none;
}
.field select:focus { border-color: var(--lime); }

.invite-row { display: flex; gap: 8px; }
.invite-link {
  flex: 1; min-width: 0;
  background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; outline: none; color: var(--lime);
}
.invite-info { margin: -6px 0 0; font-size: 13px; color: var(--text-mute); }
.invite-info:empty { display: none; }
.modal-subtitle {
  margin: 6px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-mute);
}
/* Registro de convites: criador | código | usos | expira */
.invite-log { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.invite-log-head, .invite-log-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 44px 76px;
  align-items: center; gap: 10px; padding: 6px 4px;
}
.invite-log-head { grid-template-columns: minmax(0, 1fr) auto 44px 76px; padding-left: 42px; }
.invite-log-head span { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .04em; }
.invite-log-row { border-top: 1px solid var(--line); font-size: 14px; }
.invite-log-row .avatar { width: 28px; height: 28px; font-size: 11px; }
.invite-log-who { min-width: 0; line-height: 1.2; }
.invite-log-who strong, .invite-log-who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-log-who small { color: var(--text-mute); font-size: 12px; }
.invite-log-code { font-size: 13px; color: var(--lime); }
.invite-log-uses, .invite-log-exp { font-size: 13px; color: var(--text-dim); text-align: right; }
.invite-log-row.is-dead { opacity: .45; }
.invite-log-row.is-dead .invite-log-code { color: var(--text-dim); text-decoration: line-through; }
.invite-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Toast */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--bg-3); border: 1px solid var(--lime); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.toast.is-error { border-color: var(--danger); }

.only-narrow { display: none; }

/* Telas menores: some a lista de membros; abaixo de 720 os canais viram gaveta */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 72px 240px minmax(0, 1fr); }
  .members { display: none; }
}
@media (max-width: 720px) {
  .layout, .layout.is-home { grid-template-columns: 72px minmax(0, 1fr); }
  .only-narrow { display: grid; }
  .sidebar {
    position: fixed; z-index: 10; top: 0; bottom: 0; left: 72px; width: min(260px, calc(100vw - 72px));
    transform: translateX(calc(-100% - 72px)); transition: transform .2s;
    box-shadow: 8px 0 24px rgba(0,0,0,.4);
  }
  .layout.sidebar-open .sidebar { transform: none; }
}
