/* SlamaBox — estilos da plataforma.
   Identidade: azul-noite (tinta), amarelo-caixa (ação principal e "bandeirinha"
   de não lido) e azul-carimbo (links e seleção). */

@font-face { font-family: Figtree; src: url(/assets/fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/assets/fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --ink: #121A2F; --ink-2: #2A3350; --ink-soft: #5C6682; --ink-faint: #8A93AB;
  --brand: #FFC531; --brand-deep: #EDB100; --brand-soft: #FFF3CC;
  --blue: #2B4BEE; --blue-soft: #E9EDFF;
  --paper: #F5F6FA; --surface: #FFFFFF; --line: #E2E5EF; --line-2: #EEF0F6; --hover: #ECEEF6;
  --ok: #128A5C; --ok-soft: #E0F5EA; --danger: #C93425; --danger-soft: #FCE7E4; --warn: #9A5B00; --warn-soft: #FFF1D6;
  --font: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", Figtree, system-ui, sans-serif;
  --r: 10px; --r-lg: 16px;
  --shadow: 0 10px 34px rgba(18, 26, 47, .16), 0 2px 8px rgba(18, 26, 47, .08);
  --rail-w: 68px; --side-w: 252px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.45 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.grow { flex: 1; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.block { display: block; }
.center { text-align: center; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-xs { width: 13px; height: 13px; stroke-width: 2.2; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #AD2A1D; }
.btn-link { border-color: transparent; background: none; color: var(--blue); padding: 0 6px; }
.btn-link:hover { background: var(--blue-soft); }
.btn-quiet-danger { border-color: transparent; background: none; color: var(--danger); }
.btn-quiet-danger:hover { background: var(--danger-soft); }
.btn.on-dark { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.btn.on-dark:hover { background: rgba(255, 255, 255, .18); }
.linklike { border: 0; background: none; padding: 0; color: var(--blue); text-decoration: underline; font-weight: 600; }

.ibtn { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--ink-2); }
.ibtn:hover { background: var(--hover); }
.ibtn-sm { width: 30px; height: 30px; }
.ibtn-sm .ic { width: 17px; height: 17px; }
.ibtn.is-off { opacity: .3; pointer-events: none; }
.ibtn.on-dark { color: #fff; }
.ibtn.on-dark:hover { background: rgba(255, 255, 255, .16); }
.ibtn-primary { background: var(--brand); color: var(--ink); }
.ibtn-primary:hover { background: var(--brand-deep); }
.only-mobile { display: none; }

/* ---------- formulários ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid #CDD2E1; border-radius: var(--r); background: var(--surface); }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--ink); flex: none; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 14px; }
.field-hint { color: var(--ink-soft); font-size: 13px; }
.field-row { display: flex; align-items: center; gap: 8px; }
.field-suffix { color: var(--ink-soft); white-space: nowrap; font-weight: 600; }
.form-error { color: var(--danger); font-weight: 600; background: var(--danger-soft); padding: 9px 12px; border-radius: var(--r); }
.check-row { display: flex; gap: 10px; align-items: flex-start; }
.inline-form { display: flex; gap: 10px; margin-top: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }

/* ---------- moldura ---------- */
.boot { height: 100dvh; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); height: 100dvh; }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage { flex: 1; display: flex; min-height: 0; min-width: 0; }
.rail { background: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0 14px; }
.rail-logo { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; }
.rail-item { position: relative; display: grid; justify-items: center; gap: 3px; width: 58px; padding: 9px 0 7px; border-radius: 12px; color: #B9C0D6; text-decoration: none; font-size: 11px; font-weight: 600; }
.rail-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.rail-item.active { background: rgba(255, 255, 255, .12); color: #fff; }
.rail-item.active .ic { color: var(--brand); }
.rail-badge { position: absolute; top: 3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: var(--ink); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.rail-pro { position: absolute; top: 2px; right: 3px; font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 5px; background: rgba(255, 255, 255, .16); color: #fff; letter-spacing: .02em; }
.rail-me { border: 0; background: none; padding: 4px; border-radius: 50%; }
.rail-me:hover { background: rgba(255, 255, 255, .14); }

.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--blue-soft); font-size: 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar a { font-weight: 700; }
.topbar-brand { background: var(--brand-soft); }
.topbar-danger { background: var(--danger-soft); }

.avatar { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-xl { width: 84px; height: 84px; font-size: 28px; }
.dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #B5BBCC; border: 2px solid var(--paper); }
.dot.on { background: #22B573; }

/* ---------- barra lateral das telas ---------- */
.mail, .chat { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); flex: 1; min-width: 0; min-height: 0; }
.side { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; overflow: auto; border-right: 1px solid var(--line); background: var(--paper); }
.scrim { display: none; }
.compose-btn { display: flex; align-items: center; gap: 10px; align-self: flex-start; min-height: 48px; padding: 0 22px 0 16px; margin: 0 0 12px 4px; border: 0; border-radius: 16px; background: var(--brand); font-weight: 700; font-size: 15px; box-shadow: 0 2px 0 var(--brand-deep); }
.compose-btn:hover { background: var(--brand-deep); }
.compose-btn:disabled { opacity: .5; cursor: default; }
.side-nav { display: grid; gap: 1px; }
.side-item { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 0 10px 0 12px; border-radius: 18px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.side-item:hover { background: var(--hover); }
.side-item.active { background: var(--ink); color: #fff; font-weight: 700; }
.side-item.active .ic { color: var(--brand); }
.side-item.active .ibtn { color: #fff; }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 12px; font-weight: 700; }
.side-count.strong { background: var(--brand); color: var(--ink); border-radius: 9px; padding: 1px 7px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 6px 4px 12px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.side-note { padding: 4px 12px; color: var(--ink-soft); font-size: 13px; }
.side-upsell { margin-top: auto; padding-top: 16px; }
.side-label-item { padding-right: 2px; }
.side-label-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; min-height: 36px; }
.side-label-item .ibtn { opacity: 0; }
.side-label-item:hover .ibtn, .side-label-item .ibtn:focus-visible { opacity: 1; }
.label-dot { width: 12px; height: 12px; border-radius: 4px; margin: 0 4px; flex: none; }
.has-unread .side-label { font-weight: 800; color: var(--ink); }
.side-item.active.has-unread .side-label { color: #fff; }
.conv-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--line-2); color: var(--ink-soft); }
.conv-ic .ic { width: 16px; height: 16px; }
.conv-ic.big { width: 36px; height: 36px; border-radius: 10px; }
.side-item.active .conv-ic { background: rgba(255, 255, 255, .14); color: #fff; }
.quota { margin-top: auto; padding: 16px 12px 4px; font-size: 12px; color: var(--ink-soft); display: grid; gap: 6px; }
.quota-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.quota-fill { height: 100%; border-radius: 3px; background: var(--ink); }
.quota-fill.full { background: var(--danger); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.bar { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 680px; height: 42px; padding: 0 14px; border-radius: 21px; background: var(--paper); color: var(--ink-soft); border: 1px solid transparent; }
.search:focus-within { background: var(--surface); border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search-input { border: 0 !important; background: none !important; outline: 0 !important; padding: 0 !important; min-height: 0 !important; color: var(--ink); }
.content { flex: 1; overflow: auto; min-height: 0; }

/* ---------- lista de conversas ---------- */
.list-tools { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; min-height: 50px; padding: 4px 12px 4px 18px; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.list-title { font: 700 18px/1.2 var(--display); margin: 0 8px 0 10px; }
.sel-count { font-weight: 700; margin: 0 8px; }
.pager { display: flex; align-items: center; gap: 2px; margin-left: auto; color: var(--ink-soft); font-size: 13px; }
.check { margin: 0 6px 0 0; }
.threads { list-style: none; margin: 0; padding: 0; }
.thread { position: relative; display: flex; align-items: center; gap: 2px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line-2); }
.thread:hover { background: #FAFBFE; box-shadow: inset 0 0 0 1px var(--line); }
.thread.checked { background: var(--blue-soft); }
.thread.unread { background: var(--surface); }
.thread.unread::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 22px; margin-top: -11px; background: var(--brand); border-radius: 0 4px 4px 0; }
.thread.unread .thread-who, .thread.unread .thread-subject { font-weight: 800; color: var(--ink); }
.thread.unread time { font-weight: 800; color: var(--ink); }
.star { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; background: none; color: #B6BCCD; }
.star:hover { background: var(--hover); color: var(--ink-soft); }
.star.on { color: #E0A800; }
.star.on .ic { fill: var(--brand); }
.thread-open { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; align-items: center; gap: 14px; flex: 1; min-width: 0; min-height: 46px; padding: 6px 4px; border: 0; background: none; text-align: left; }
.thread-who { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.thread-n { color: var(--ink-faint); font-size: 12px; font-weight: 600; }
.thread-draft { color: var(--danger); font-size: 12px; font-weight: 700; }
.thread-text { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.thread-subject { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.thread-snippet { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-faint); }
.thread-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.chip { --chip: #5C6682; flex: none; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 6px; color: var(--chip); background: color-mix(in srgb, var(--chip) 13%, #fff); white-space: nowrap; }
.chip-danger { --chip: var(--danger); }
.list-loading { padding: 60px 0; }

.empty { display: grid; justify-items: center; gap: 10px; max-width: 460px; margin: 0 auto; padding: 72px 24px; text-align: center; color: var(--ink-soft); }
.empty-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--ink); margin-bottom: 6px; }
.empty-ic .ic { width: 28px; height: 28px; }
.empty h3 { font: 700 20px/1.25 var(--display); color: var(--ink); }
.empty .btn { margin-top: 8px; }

/* ---------- conversa aberta ---------- */
.thread-view { max-width: 940px; padding: 8px 24px 40px; }
.thread-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 0 12px 48px; }
.thread-head h1 { font: 600 22px/1.25 var(--display); margin-right: 6px; overflow-wrap: anywhere; }
.msg { border-top: 1px solid var(--line-2); padding: 4px 0; }
.msg-head { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.msg-head-main { display: grid; gap: 1px; flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 2px 0; }
.msg-from { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-addr { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.msg-to { color: var(--ink-soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .when-open { display: none; }
.msg.open .when-open { display: inline; }
.msg.open .when-closed { display: none; }
.msg-date { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.msg-actions { display: flex; }
.msg-details { margin: 0 0 10px 48px; padding: 10px 14px; border-radius: var(--r); background: var(--paper); font-size: 13px; display: grid; gap: 3px; overflow-wrap: anywhere; }
.msg-body { display: none; padding: 0 0 16px 48px; }
.msg.open .msg-body { display: grid; gap: 12px; }
.msg-frame { width: 100%; height: 60px; border: 0; display: block; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.msg-note { color: var(--ink-soft); }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r); background: var(--paper); font-size: 14px; }
.banner > span { flex: 1; min-width: 200px; }
.banner .btn { min-height: 32px; padding: 0 10px; font-size: 13px; }
.banner-danger { background: var(--danger-soft); color: #7A1F15; }
.banner-warn { background: var(--warn-soft); color: #5F3900; }
.banner-ok { background: var(--ok-soft); color: #0B5A3B; }
.banner-brand { background: var(--brand-soft); }
.atts, .cmp-atts { display: flex; flex-wrap: wrap; gap: 8px; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 320px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; }
a.att:hover { background: var(--hover); }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-size { color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.att-x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--ink-soft); }
.att-x:hover { background: var(--hover); }
.att.pending .ic { animation: spin 1s linear infinite; }
.reply-bar { display: flex; gap: 10px; flex-wrap: wrap; padding: 18px 0 0 48px; border-top: 1px solid var(--line-2); }

/* ---------- escrever ---------- */
.cmp { position: fixed; right: 24px; bottom: 0; z-index: 40; display: flex; flex-direction: column; width: min(580px, calc(100vw - 110px)); height: min(640px, calc(100dvh - 70px)); background: var(--surface); border-radius: 14px 14px 0 0; box-shadow: var(--shadow); overflow: hidden; }
.cmp.min { height: 46px; }
.cmp.drop { outline: 3px dashed var(--blue); outline-offset: -6px; }
.cmp-head { display: flex; align-items: center; gap: 4px; height: 46px; flex: none; padding: 0 8px 0 16px; background: var(--ink); color: #fff; }
.cmp-head h2 { flex: 1; font: 600 15px var(--font); }
.cmp-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rcpt { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--line-2); }
.rcpt-label { color: var(--ink-soft); padding-top: 6px; min-width: 34px; font-size: 14px; }
.rcpt-box { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-width: 0; align-items: center; cursor: text; }
.rcpt-chips { display: contents; }
.rcpt-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 4px 2px 10px; border-radius: 14px; background: var(--blue-soft); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcpt-chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: var(--ink-soft); }
.rcpt-chip button:hover { background: rgba(18, 26, 47, .12); }
.rcpt-input { flex: 1; min-width: 80px; border: 0 !important; outline: 0 !important; padding: 4px 0 !important; min-height: 30px !important; border-radius: 0 !important; }
.rcpt-input.bad { color: var(--danger); text-decoration: underline wavy var(--danger); }
.cmp-cc { border: 0; background: none; color: var(--ink-soft); font-size: 13px; padding: 6px 4px; white-space: nowrap; }
.cmp-cc:hover { color: var(--blue); text-decoration: underline; }
.rcpt-drop { position: absolute; left: 58px; right: 16px; top: 100%; z-index: 5; display: grid; padding: 6px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.rcpt-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; text-align: left; }
.rcpt-opt.hi, .rcpt-opt:hover { background: var(--hover); }
.rcpt-opt span { display: grid; min-width: 0; }
.rcpt-opt small { color: var(--ink-soft); }
.cmp-subject { border: 0 !important; border-bottom: 1px solid var(--line-2) !important; border-radius: 0 !important; padding: 10px 16px !important; font-weight: 600; outline: 0 !important; flex: none; }
.cmp-tools { display: flex; gap: 2px; padding: 4px 10px; border-bottom: 1px solid var(--line-2); flex: none; }
.editor { flex: 1; min-height: 80px; overflow: auto; padding: 14px 16px; outline: 0; line-height: 1.55; overflow-wrap: anywhere; contain: content; }
.editor img { max-width: 100%; height: auto; }
.editor blockquote { margin: 8px 0 8px 4px; padding-left: 12px; border-left: 2px solid #C8CCD8; color: #3d4763; }
.editor-sm { min-height: 96px; max-height: 220px; border: 1px solid #CDD2E1; border-radius: var(--r); flex: none; }
.editor-sm:focus-visible { outline: 2px solid var(--blue); border-color: var(--blue); }
.cmp-atts { padding: 0 16px 8px; flex: none; }
.cmp-atts:empty { display: none; }
.cmp-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line-2); flex: none; }
.cmp-status { color: var(--ink-soft); font-size: 13px; margin-left: 6px; }

/* ---------- chat ---------- */
.chat-bar { gap: 12px; }
.chat-title { flex: 1; min-width: 0; }
.chat-title h1 { font: 700 17px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title p { color: var(--ink-soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list { flex: 1; min-height: 0; overflow: auto; padding: 12px 20px 6px; }
.cm { position: relative; display: flex; gap: 12px; padding: 7px 8px 3px; border-radius: 8px; }
.cm.compact { padding-top: 1px; }
.cm:hover { background: var(--paper); }
.cm-gutter { width: 36px; flex: none; color: transparent; font-size: 10px; text-align: right; padding-top: 4px; }
.cm:hover .cm-gutter { color: var(--ink-faint); }
.cm-main { min-width: 0; flex: 1; }
.cm-meta { display: flex; align-items: baseline; gap: 8px; }
.cm-meta time { color: var(--ink-faint); font-size: 12px; }
.cm-body { display: grid; gap: 6px; justify-items: start; }
.cm-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.cm-edited, .cm-deleted { color: var(--ink-faint); font-size: 12px; }
.cm-deleted { font-style: italic; font-size: 14px; }
.cm-tools { position: absolute; right: 8px; top: -12px; display: none; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cm:hover .cm-tools, .cm:focus-within .cm-tools { display: flex; }
.cm-img img { display: block; max-width: min(360px, 100%); max-height: 300px; border-radius: 10px; border: 1px solid var(--line); }
.cm-system { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 6px 0; }
.cm-day { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.cm-day::before, .cm-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cm-more { text-align: center; padding: 8px 0 12px; }
.cm-meet { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cm-meet > span { display: grid; }
.cm-meet small { color: var(--ink-soft); }
.chat-typing { height: 18px; padding: 0 28px; color: var(--ink-soft); font-size: 12px; }
.chat-compose { padding: 0 20px 16px; display: grid; gap: 8px; }
.chat-compose .cmp-atts { padding: 0; }
.chat-compose-row { display: flex; align-items: flex-end; gap: 6px; padding: 6px; border: 1px solid #CDD2E1; border-radius: 16px; background: var(--surface); }
.chat-compose-row:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.chat-input { border: 0 !important; outline: 0 !important; resize: none; min-height: 38px !important; max-height: 160px; padding: 8px 4px !important; }

.picker { display: grid; gap: 10px; }
.pick-list { display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; text-align: left; }
button.pick:hover { background: var(--hover); }
.pick.on { background: var(--blue-soft); }
.pick > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.pick small { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- páginas (admin, reuniões, conta) ---------- */
.page { flex: 1; min-width: 0; overflow: auto; padding: 28px 32px 60px; }
.page > * { max-width: 1060px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font: 700 30px/1.15 var(--display); letter-spacing: -.01em; }
.page-head p { color: var(--ink-soft); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; }
.page-body { display: grid; gap: 18px; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--ink-soft); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; display: grid; gap: 12px; }
.card h2 { font: 700 19px/1.25 var(--display); }
.card > .btn, .card > div > .btn:only-child { justify-self: start; }
.card h3 { display: flex; align-items: center; gap: 10px; font: 700 16px/1.3 var(--font); }
.card-narrow { max-width: 640px; margin-left: 0 !important; }
.card-danger { border-color: #F0C2BC; }
.card-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.card-head > div:first-child { flex: 1; min-width: 200px; }
.card-head p { color: var(--ink-soft); margin-top: 2px; }
.card-head input[type=search] { max-width: 360px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: inherit; text-decoration: none; min-width: 0; }
a.stat:hover { border-color: var(--ink-faint); }
.stat-label { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.stat-value { font: 700 22px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-sub { color: var(--ink-soft); font-size: 13px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: flex-start; gap: 12px; }
.step-mark { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid #C5CADB; color: var(--ink-faint); }
.step-mark .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.steps li.done .step-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done > span:last-child { color: var(--ink-soft); }
.step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 8px; background: var(--line-2); color: var(--ink-2); font-size: 12px; font-weight: 700; white-space: nowrap; margin-right: 4px; }
.badge-ok { background: var(--ok-soft); color: #0B5A3B; }
.badge-wait { background: var(--warn-soft); color: #6B4100; }
.badge-danger { background: var(--danger-soft); color: #8E2318; }
.badge-blue { background: var(--blue-soft); color: #1B31A8; }
.badge-brand { background: var(--brand-soft); color: #5C4300; }
.dns { display: grid; gap: 8px; }
.dns-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.dns-row.ok { border-color: #BFE6D1; background: #F6FCF9; }
.dns-type { display: grid; width: 74px; flex: none; }
.dns-type small { color: var(--ink-soft); font-size: 11px; }
.dns-field { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dns-field small { color: var(--ink-soft); font-size: 12px; }
.dns-field code { background: var(--paper); padding: 4px 8px; border-radius: 6px; overflow-wrap: anywhere; word-break: break-all; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--ink-soft); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-suspended { opacity: .6; }
.td-actions { width: 44px; text-align: right; }
.person { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.person > div { display: grid; min-width: 0; }
.person small { color: var(--ink-soft); }
.usage { display: grid; gap: 4px; min-width: 130px; }
.usage small { color: var(--ink-soft); font-size: 12px; }
.cap-select { min-width: 190px; min-height: 36px; padding: 4px 8px; }
.cred { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--paper); }
.cred > div { display: grid; gap: 2px; }
.cred small { color: var(--ink-soft); }
.cred code { font-size: 15px; overflow-wrap: anywhere; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan { display: grid; gap: 12px; align-content: start; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.plan.current { border: 2px solid var(--ink); padding: 23px; }
.plan h3 { font: 700 22px/1.2 var(--display); }
.plan-price b { font: 700 34px/1 var(--display); letter-spacing: -.02em; }
.plan-price span { color: var(--ink-soft); }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-list li { display: flex; gap: 10px; align-items: flex-start; }
.plan-list li .ic { color: var(--ok); margin-top: 1px; }
.plan-list li.no { color: var(--ink-faint); }
.plan-list li.no .ic { color: var(--ink-faint); }
.plan-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 9px; border: 2px solid transparent; }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.join-row { display: flex; gap: 10px; max-width: 520px !important; margin: 0 0 20px !important; }
.meet-list { list-style: none; margin: 0; padding: 0; display: grid; }
.meet-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.meet-row:first-child { border-top: 0; }
.meet-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--line-2); color: var(--ink-soft); }
.meet-ic.live { background: var(--ok-soft); color: var(--ok); }
.meet-info { display: grid; flex: 1; min-width: 0; }
.meet-info small { color: var(--ink-soft); }

/* ---------- sala de reunião ---------- */
body.in-room .rail, body.in-room .banners { display: none; }
body.in-room .shell { grid-template-columns: minmax(0, 1fr); }
.room { flex: 1; display: flex; min-width: 0; min-height: 0; background: #0B1020; color: #fff; }
.room-lobby { flex: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; max-width: 1040px; margin: 0 auto; padding: 32px; }
.room-lobby .empty { color: #C6CCE0; grid-column: 1 / -1; }
.room-lobby .empty h3 { color: #fff; }
.lobby-left { display: grid; gap: 14px; justify-items: center; }
.lobby-preview { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: #1A2238; }
.lobby-preview video, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mirror { transform: scaleX(-1); }
.tile-off { position: absolute; inset: 0; display: none; place-items: center; background: #1A2238; }
.off > .tile-off { display: grid; }
.off > video { visibility: hidden; }
.lobby-ctl, .room-ctl { display: flex; gap: 12px; justify-content: center; }
.lobby-right { display: grid; gap: 12px; }
.lobby-right h1 { font: 700 32px/1.15 var(--display); }
.lobby-right p { color: #C6CCE0; }
.lobby-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.room .btn:not(.btn-primary) { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.room .btn:not(.btn-primary):hover { background: rgba(255, 255, 255, .18); }
.ctl { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; }
.ctl:hover { background: rgba(255, 255, 255, .24); }
.ctl:disabled { opacity: .4; cursor: default; }
.ctl.off { background: #fff; color: var(--danger); }
.ctl.active { background: var(--brand); color: var(--ink); }
.ctl.leave { background: var(--danger); width: 68px; border-radius: 26px; }
.ctl.leave:hover { background: #AD2A1D; }
.ctl[data-badge]:not([data-badge=""])::after { content: attr(data-badge); position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: var(--ink); font-size: 11px; font-weight: 800; line-height: 20px; }
.room-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.room-head { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.room-head h1 { font: 700 17px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-count { color: #AEB6CF; font-size: 13px; white-space: nowrap; }
.tiles { flex: 1; min-height: 0; display: grid; gap: 10px; padding: 0 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.tiles[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
.tiles[data-n="5"], .tiles[data-n="6"], .tiles[data-n="7"], .tiles[data-n="8"], .tiles[data-n="9"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { position: relative; border-radius: 16px; overflow: hidden; background: #1A2238; min-height: 0; }
.tile.screen video { object-fit: contain; background: #000; }
.tiles.sharing { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 3fr) minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); }
.tiles.sharing .tile.screen { grid-column: 1 / -1; grid-row: 1; }
.tile-name { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 8px; background: rgba(11, 16, 32, .72); font-size: 13px; font-weight: 600; }
.tile.connecting::after { content: "Conectando…"; position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 8px; background: rgba(11, 16, 32, .72); font-size: 12px; }
.room-ctl { padding: 14px; }
.room-chat { display: flex; flex-direction: column; width: 320px; flex: none; margin: 12px 12px 12px 0; border-radius: 16px; background: #fff; color: var(--ink); overflow: hidden; }
.room-chat header { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.room-chat h2 { font: 700 15px var(--font); }
.room-chat-list { flex: 1; overflow: auto; padding: 12px 14px; display: grid; gap: 10px; align-content: start; }
.rc b { font-size: 13px; }
.rc time { color: var(--ink-faint); font-size: 11px; margin-left: 6px; }
.rc p { overflow-wrap: anywhere; }
.room-chat form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }

/* ---------- janelas, menus e avisos ---------- */
.modal { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 18px; box-shadow: var(--shadow); color: var(--ink); overflow: hidden; }
.modal[open] { display: flex; flex-direction: column; }
.modal-wide { width: min(680px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(18, 26, 47, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 6px 22px; }
.modal-head h2 { font: 700 20px/1.25 var(--display); }
.modal-body { padding: 8px 22px 16px; overflow: auto; display: grid; gap: 12px; }
.modal-text { color: var(--ink-2); line-height: 1.5; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 18px; }
.pop { position: fixed; z-index: 100; min-width: 210px; max-width: 320px; padding: 6px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); display: grid; }
.pop-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; text-align: left; }
.pop-item:hover, .pop-item:focus-visible { background: var(--hover); outline: 0; }
.pop-item.danger { color: var(--danger); }
.pop-item span { flex: 1; }
.pop-check { color: var(--blue); }
.pop-sep { height: 1px; margin: 5px 4px; background: var(--line); }
#toasts { position: fixed; left: 88px; bottom: 20px; z-index: 200; display: grid; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow); animation: rise .18s ease-out; }
.toast-error { background: #7A1F15; }
.toast-action { border: 0; background: none; color: var(--brand); font-weight: 800; padding: 0; white-space: nowrap; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- telas de entrada (login, cadastro, bloqueio) ---------- */
body.auth { overflow: auto; background: var(--surface); }
.auth-wrap { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 48px; background: var(--ink); color: #fff; overflow: hidden; }
.auth-brand { display: flex; align-items: center; gap: 12px; font: 700 22px var(--display); color: #fff; text-decoration: none; }
.auth-pitch h1 { font: 700 clamp(30px, 3.4vw, 46px)/1.08 var(--display); letter-spacing: -.02em; max-width: 13em; }
.auth-pitch p { margin-top: 16px; color: #C6CCE0; font-size: 17px; max-width: 30em; }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: #E6E9F4; }
.auth-points .ic { color: var(--brand); margin-top: 2px; }
.auth-flag { position: absolute; right: -40px; bottom: -30px; width: 260px; opacity: .14; }
.auth-foot { color: #9BA4C0; font-size: 13px; }
.auth-foot a { color: #C6CCE0; }
.auth-main { display: grid; place-items: center; padding: 44px 28px; }
.auth-form { width: min(420px, 100%); display: grid; gap: 16px; }
.auth-form h2 { font: 700 30px/1.15 var(--display); letter-spacing: -.01em; }
.auth-form > p { color: var(--ink-soft); }
.auth-form .btn-primary { min-height: 46px; font-size: 16px; }
.auth-alt { color: var(--ink-soft); text-align: center; }
.pw-row { position: relative; }
.pw-row input { padding-right: 46px; }
.pw-row .ibtn { position: absolute; right: 2px; top: 1px; }
.plan-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-opt { position: relative; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid #CDD2E1; border-radius: 12px; cursor: pointer; }
.plan-opt input { position: absolute; opacity: 0; }
.plan-opt b { font-size: 15px; }
.plan-opt small { color: var(--ink-soft); }
.plan-opt:has(input:checked) { border: 2px solid var(--ink); padding: 11px 13px; background: var(--brand-soft); }
.plan-opt:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.notice { padding: 12px 14px; border-radius: var(--r); background: var(--ok-soft); color: #0B5A3B; font-weight: 600; }

.gate { min-height: 100dvh; overflow: auto; max-height: 100dvh; display: grid; align-content: start; justify-items: center; gap: 18px; padding: 48px 20px; }
.gate > * { width: min(640px, 100%); }
.gate-wide > * { width: min(980px, 100%); }
.gate-brand { display: flex; align-items: center; gap: 12px; font: 700 22px var(--display); }
.gate-title { font: 700 34px/1.12 var(--display); letter-spacing: -.02em; }
.gate-sub { color: var(--ink-soft); font-size: 17px; margin-top: -8px; }
.gate .card h1 { font: 700 24px/1.2 var(--display); }
.gate .card-narrow { max-width: none; }

/* ---------- celular ---------- */
@media (max-width: 760px) {
  .only-mobile { display: inline-grid; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); gap: 0; }
  .rail-logo, .rail .grow { display: none; }
  .rail-item { width: auto; flex: 1; padding: 7px 0 5px; }
  .rail-me .avatar { width: 30px; height: 30px; font-size: 11px; }
  .mail, .chat { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(86vw, 300px); transform: translateX(-102%); transition: transform .18s ease-out; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .side.open + .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(18, 26, 47, .4); }
  .bar { padding: 8px 10px; min-height: 54px; }
  .list-tools { padding: 4px 6px 4px 12px; flex-wrap: wrap; }
  .thread { padding: 0 8px 0 12px; align-items: flex-start; }
  .thread .check, .thread .star { margin-top: 8px; }
  .thread-open { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 2px; }
  .thread-text { grid-column: 1 / -1; grid-row: 2; }
  .thread-meta { grid-column: 2; grid-row: 1; }
  .thread-view { padding: 4px 14px 32px; }
  .thread-head, .msg-body, .reply-bar, .msg-details { padding-left: 0; margin-left: 0; }
  .msg-addr { display: none; }
  .cmp { inset: 0; width: 100%; height: 100dvh; border-radius: 0; z-index: 80; }
  .cmp.min { top: auto; height: 46px; bottom: 60px; }
  .chat-list { padding: 10px 8px 4px; }
  .chat-compose { padding: 0 8px 10px; }
  .hide-label-mobile span { display: none; }
  .page { padding: 18px 14px 40px; }
  .page-head h1 { font-size: 25px; }
  .stats, .plans { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 16px; }
  .inline-form { flex-direction: column; }
  #toasts { left: 12px; right: 12px; bottom: 70px; max-width: none; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px 22px; gap: 20px; }
  .auth-points, .auth-flag { display: none; }
  .auth-main { padding: 28px 20px 48px; place-items: start center; }
  .room-lobby { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 18px; align-content: start; }
  .tiles { grid-template-columns: minmax(0, 1fr) !important; padding: 0 8px; }
  .tiles[data-n="3"], .tiles[data-n="4"], .tiles[data-n="5"], .tiles[data-n="6"], .tiles[data-n="7"], .tiles[data-n="8"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .room-chat { position: fixed; inset: 0; width: auto; margin: 0; border-radius: 0; z-index: 90; }
  .ctl { width: 48px; height: 48px; }
  .dns-field.grow { flex-basis: 100%; }
}

@media (min-width: 761px) and (max-width: 1080px) {
  :root { --side-w: 210px; }
  .thread-open { grid-template-columns: 150px minmax(0, 1fr) auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media (forced-colors: active) {
  .thread.unread::before { background: Highlight; }
  .btn, .ibtn, .ctl { border: 1px solid ButtonText; }
}
