/* myIQMail - sistema de design (tokens semanticos claro/escuro, componentes, layout do cliente de email).
   Regras do design: foco visivel sempre, estado nunca so por cor (icone + texto), alvos >= 36px (44px em toque),
   movimento 120-240ms com prefers-reduced-motion, numeros tabulares nos dados. */

:root {
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f7f9fc; --surface-3: #edf1f8; --overlay: rgb(15 23 42 / .5);
  --border: #e1e7f0; --border-strong: #c8d2e2;
  --text: #0f172a; --text-2: #475569; --text-3: #5b6b82;
  --primary: #2563eb; --primary-hover: #1d4ed8; --primary-soft: #e6eefe; --on-primary: #ffffff;
  --ai: #7c3aed; --ai-soft: #f1ebff; --ai-border: #d9c8fb;
  --p1: #dc2626; --p1-soft: #fee2e2; --p1-text: #b91c1c;
  --p2: #ea580c; --p2-soft: #ffedd5; --p2-text: #b45309;
  --p3: #0e7490; --p3-soft: #cffafe; --p3-text: #0e6378;
  --p4: #64748b; --p4-soft: #e9eef5; --p4-text: #475569;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --err: #b91c1c; --err-soft: #fee2e2;
  --focus: 0 0 0 3px rgb(37 99 235 / .35);

  --shadow-1: 0 1px 2px rgb(15 23 42 / .06), 0 1px 3px rgb(15 23 42 / .06);
  --shadow-2: 0 8px 24px rgb(15 23 42 / .12);
  --shadow-3: 0 24px 56px rgb(15 23 42 / .22);
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1); --dur: 160ms;
  --topbar-h: 56px; --side-w: 244px; --list-w: 400px;
  --row-h: 68px; --rail-w: 72px;
  --side-bg: #171b2e; --side-text: #b9c0da; --side-active: #3b6cf6; --prio-bg: #fff4e5;
}

[data-theme="dark"] {
  --bg: #0a0f1f; --surface: #111831; --surface-2: #151d3a; --surface-3: #1b2547; --overlay: rgb(2 6 23 / .66);
  --border: #232e55; --border-strong: #35427a;
  --text: #e9edf9; --text-2: #b0bad8; --text-3: #8f9bc2;
  --primary: #6b9bff; --primary-hover: #8fb3ff; --primary-soft: #1a2a57; --on-primary: #0a1020;
  --ai: #b196ff; --ai-soft: #231b4a; --ai-border: #44368a;
  --p1: #ff6b6b; --p1-soft: #3a1620; --p1-text: #ff8e8e;
  --p2: #ff9a52; --p2-soft: #3a2314; --p2-text: #ffb27a;
  --p3: #4fd1e6; --p3-soft: #0f2c36; --p3-text: #7fe0f0;
  --p4: #94a3b8; --p4-soft: #1e2744; --p4-text: #a9b6cc;
  --ok: #4ade80; --ok-soft: #12301f; --warn: #fbbf24; --warn-soft: #3a2c0d; --err: #ff8080; --err-soft: #3a1620;
  --focus: 0 0 0 3px rgb(107 155 255 / .45);
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4); --shadow-2: 0 10px 28px rgb(0 0 0 / .5); --shadow-3: 0 28px 64px rgb(0 0 0 / .62);
  --side-bg: #0b0f1d; --side-text: #aeb7d6; --side-active: #4f7cff; --prio-bg: #2b2114;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.num, .kpi__value { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-3); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: var(--r); z-index: 2000; transition: top var(--dur); }
.skip-link:focus { top: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: var(--primary-soft); }
[hidden] { display: none !important; }
.fa-solid, .fa-regular, .fa-brands { line-height: 1; }

/* ---------------------------------------------------------------- botoes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 550; cursor: pointer; transition: background var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur), transform 80ms; white-space: nowrap; user-select: none; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--ai { background: linear-gradient(135deg, #7c3aed, #2563eb); border-color: transparent; color: #fff; }
.btn--ai:hover { filter: brightness(1.08); background: linear-gradient(135deg, #7c3aed, #2563eb); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }
.btn--danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--border)); }
.btn--danger:hover { background: var(--err-soft); }
.btn--sm { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--r-sm); }
.btn--lg { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn--icon { width: 36px; padding: 0; } .btn--icon.btn--sm { width: 30px; }
.btn.is-loading { pointer-events: none; opacity: .75; } .btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------------------------------------------------------------- formularios */
.field { display: grid; gap: 6px; margin-bottom: 14px; align-content: start; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--text-3); }
.input, select.input, textarea.input { width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); transition: border-color var(--dur), box-shadow var(--dur); }
input.input[type="time"], input.input[type="date"] { height: 38px; padding-top: 0; padding-bottom: 0; }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--err); }
.form-error { color: var(--err); font-size: 13px; min-height: 18px; margin-top: 4px; }
.row { display: flex; gap: 12px; align-items: center; } .row--wrap { flex-wrap: wrap; } .row--between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; align-items: start; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 40px; height: 22px; margin: 0; cursor: pointer; }
.switch__track { width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background var(--dur); flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease); box-shadow: var(--shadow-1); }
.switch input:checked + .switch__track { background: var(--primary); } .switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--r); gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-weight: 550; color: var(--text-2); min-height: 28px; display: inline-flex; align-items: center; gap: 6px; transition: background var(--dur), color var(--dur); }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
kbd { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--text-2); }

/* ---------------------------------------------------------------- chips, badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge--ok { background: var(--ok-soft); color: var(--ok); } .badge--warn { background: var(--warn-soft); color: var(--warn); } .badge--err { background: var(--err-soft); color: var(--err); } .badge--ai { background: var(--ai-soft); color: var(--ai); } .badge--primary { background: var(--primary-soft); color: var(--primary); }
.prio { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prio i { font-size: 10px; }
.prio--1 { background: var(--p1-soft); color: var(--p1-text); } .prio--2 { background: var(--p2-soft); color: var(--p2-text); } .prio--3 { background: var(--p3-soft); color: var(--p3-text); } .prio--4 { background: var(--p4-soft); color: var(--p4-text); }
.prio--none { background: transparent; color: var(--text-3); border: 1px dashed var(--border-strong); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- cartoes, tabelas */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card__head h2, .card__head h3 { display: flex; align-items: center; gap: 8px; } .card__body { padding: 18px; } .card__head i { color: var(--text-3); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tbody tr:hover { background: var(--surface-2); }
.table .r, .table td.num { text-align: right; } .table th.r { text-align: right; }
.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty i { font-size: 34px; opacity: .55; } .empty h3 { color: var(--text-2); }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--r-sm); min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .5s var(--ease); }
.progress.is-warn > span { background: var(--warn); } .progress.is-err > span { background: var(--err); } .progress.is-ok > span { background: var(--ok); }

/* ---------------------------------------------------------------- topbar / shell */
.app { display: grid; grid-template-rows: var(--topbar-h) 1fr; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16px; letter-spacing: -.02em; color: var(--text); text-decoration: none !important; min-width: calc(var(--side-w) - 32px); }
.brand__mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-size: 15px; box-shadow: 0 4px 12px rgb(79 70 229 / .35); }
.brand b { color: var(--primary); font-weight: 750; }
.nav-tabs { display: flex; gap: 2px; }
.nav-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; height: 36px; border-radius: var(--r); color: var(--text-2); font-weight: 550; text-decoration: none; transition: background var(--dur), color var(--dur); }
.nav-tabs a:hover { background: var(--surface-3); color: var(--text); }
.nav-tabs a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.topbar__search { position: relative; flex: 1; max-width: 560px; }
.topbar__search i.fa-magnifying-glass { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.topbar__search .input { padding-left: 38px; padding-right: 74px; background: var(--surface-3); border-color: transparent; border-radius: 999px; }
.topbar__search .input:focus { background: var(--surface); }
.topbar__search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.topbar__spacer { flex: 1; }
.ia-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--ai-soft); color: var(--ai); border: 1px solid var(--ai-border); cursor: pointer; }
.ia-status.is-off { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .ia-status.is-limit { background: var(--err-soft); color: var(--err); border-color: transparent; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; flex: none; }
.menu { position: absolute; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 6px; animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; text-align: left; color: var(--text); text-decoration: none; min-height: 36px; }
.menu button:hover, .menu a:hover, .menu [aria-selected="true"] { background: var(--surface-3); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; } .menu i { width: 16px; text-align: center; color: var(--text-3); }
.menu .menu__label { padding: 6px 10px 2px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }

/* ---------------------------------------------------------------- pagina de conteudo (dashboard, treino, ...) */
.page { overflow: auto; padding: 24px clamp(16px, 3vw, 40px) 56px; }
.page__inner { max-width: 1320px; margin: 0 auto; display: grid; gap: 20px; }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page__head p { color: var(--text-3); margin-top: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tabs button:hover { color: var(--text); } .tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi__label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.kpi__value { font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.kpi__sub { margin-top: 6px; font-size: 12.5px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.kpi__icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.kpi--p1 { border-left: 4px solid var(--p1); } .kpi--p2 { border-left: 4px solid var(--p2); } .kpi--ai { border-left: 4px solid var(--ai); }
.charts { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.chart-box { position: relative; height: 260px; } .chart-box--sm { height: 210px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ok); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
details.dados { margin-top: 10px; } details.dados summary { cursor: pointer; font-size: 12.5px; color: var(--text-3); } details.dados[open] summary { margin-bottom: 8px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-top: 8px; } .section-title h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.section-title::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- cliente de email */
/* separadores arrastaveis entre colunas (js/colunas.js) */
.colresize { position: absolute; top: 0; bottom: 0; width: 9px; z-index: 6; cursor: col-resize; touch-action: none; outline: none; }
.colresize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
/* pega sempre visivel (uma pequena barra ao meio), para se perceber que a coluna se pode arrastar */
.colresize::before { content: ""; position: absolute; top: 50%; left: 2px; width: 5px; height: 44px; margin-top: -22px; border-radius: 3px; background: #8a96b0; border: 1px solid var(--surface); opacity: .85; transition: opacity .15s, background .15s; }
.colresize:hover::after, .colresize:focus-visible::after, .colresize.is-drag::after { background: var(--primary, #3b6cf6); }
.colresize:hover::before, .colresize:focus-visible::before, .colresize.is-drag::before { background: var(--primary, #3b6cf6); opacity: 1; }
.colresize--side { left: calc(var(--side-w) - 4px); }
.colresize--list { left: calc(var(--side-w) + var(--list-w) - 4px); }
.mail:has(.reader__empty) .colresize--list, .app.is-rail .colresize--side { display: none; }
body.is-resizing { cursor: col-resize; user-select: none; } body.is-resizing * { pointer-events: none; }
@media (max-width: 800px) { .colresize { display: none; } }

.mail { position: relative; display: grid; grid-template-columns: var(--side-w) var(--list-w) minmax(0, 1fr); min-height: 0; background: var(--surface); }
/* sem conversa aberta a lista ocupa toda a largura (como nos clientes modernos); ao abrir, passa a 3 colunas */
.mail:has(.reader__empty) { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.mail:has(.reader__empty) .reader { display: none; }
.app.is-rail { --side-w: var(--rail-w); }

/* barra lateral escura, continua com a marca no topo */
.topbar--mail { padding-left: 0; background: var(--surface); border-bottom: 0; box-shadow: 0 1px 0 var(--border); }
.topbar--mail .brand { align-self: stretch; width: var(--side-w); min-width: 0; padding: 0 0 0 20px; background: var(--side-bg); color: #fff; margin-right: 4px; flex: none; }
.topbar--mail .brand b { color: #8db0ff; }
.topbar--mail .nav-tabs { display: none; }
.app.is-rail .topbar--mail .brand { padding: 0; justify-content: center; } .app.is-rail .topbar--mail .brand .t { display: none; }
.sidebar { overflow-y: auto; padding: 4px 12px 16px; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .18) transparent; }
.side-top { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; }
.side-compose { flex: 1; min-height: 42px; border: 0; border-radius: 12px; background: var(--side-active); color: #fff; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; transition: filter var(--dur), transform var(--dur); }
.side-compose:hover { filter: brightness(1.1); } .side-compose:active { transform: scale(.98); }
.side-toggle { width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--side-text); cursor: pointer; } .side-toggle:hover { background: rgb(255 255 255 / .08); color: #fff; }
.side-toggle i { transition: transform var(--dur); } .app.is-rail .side-toggle i { transform: rotate(180deg); }
.side-label { padding: 18px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .38); display: flex; justify-content: space-between; align-items: center; }
.side-label a { color: inherit; }
.side-empty { padding: 6px 12px; color: var(--side-text); } .side-empty a { color: #8db0ff; }
.menu-toggle { display: none !important; }
.side-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 0 10px; min-height: 38px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--side-text); font-weight: 500; text-align: left; text-decoration: none !important; transition: background var(--dur), color var(--dur); position: relative; }
.side-item:hover { background: rgb(255 255 255 / .07); color: #fff; }
.side-item[aria-current="true"] { background: var(--side-active); color: #fff; font-weight: 650; }
.side-item i.ic { width: 20px; text-align: center; font-size: 15px; flex: none; }
.side-item .count { margin-left: auto; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; opacity: .8; }
.side-item .count.hot { background: rgb(255 255 255 / .16); color: #fff; padding: 0 8px; border-radius: 999px; opacity: 1; } .side-item[aria-current="true"] .count.hot { background: rgb(255 255 255 / .26); }
.side-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .dot { width: 10px; height: 10px; margin: 0 5px; flex: none; }
.side-item .sync { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; flex: none; } .side-item .sync.err { background: #ff6b6b; } .side-item .sync.paused { background: #94a3b8; }
.sidebar__foot { margin-top: auto; padding: 16px 12px 0; font-size: 12px; color: rgb(255 255 255 / .4); } .sidebar__foot kbd { background: rgb(255 255 255 / .1); border-color: transparent; color: #fff; }
.app.is-rail .sidebar { padding: 4px 8px 16px; align-items: center; }
.app.is-rail .side-top { flex-direction: column; } .app.is-rail .side-compose { width: 44px; flex: none; min-height: 44px; } .app.is-rail .side-compose span { display: none; }
.app.is-rail .side-item { width: 44px; justify-content: center; padding: 0; } .app.is-rail .side-item .name, .app.is-rail .side-item .sync, .app.is-rail .side-label > :not(a), .app.is-rail .side-label a, .app.is-rail .sidebar__foot { display: none; }
.app.is-rail .side-label { padding: 6px 0 2px; width: 24px; border-top: 1px solid rgb(255 255 255 / .12); margin-top: 8px; }
.app.is-rail .side-item .count { position: absolute; top: 3px; right: 1px; margin: 0; font-size: 10px; padding: 0 5px; line-height: 15px; background: var(--side-active); color: #fff; border-radius: 999px; opacity: 1; } .app.is-rail .side-item .count:not(.hot) { background: #3a4263; box-shadow: 0 0 0 2px var(--side-bg); }
.app.is-rail .side-item .count { box-shadow: 0 0 0 2px var(--side-bg); }
.app.is-rail .side-label { font-size: 0; letter-spacing: 0; }

/* avatares */
.av { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em; user-select: none; }
.av--sm { width: 24px; height: 24px; font-size: 10.5px; }
.av.ring-1 { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--p1); } .av.ring-2 { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--p2); }

/* lista */
.listpane { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--surface); container-type: inline-size; container-name: lista; }
.mail:not(:has(.reader__empty)) .listpane { border-right: 1px solid var(--border); }
.list-toolbar { display: flex; align-items: center; gap: 6px; padding: 18px 24px 6px; flex-wrap: wrap; }
.list-toolbar h2 { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin-right: auto; display: flex; flex-direction: column; gap: 0; line-height: 1.15; }
.list-toolbar h2 .tiny { font-weight: 500; font-size: 12.5px; color: var(--text-3); letter-spacing: 0; margin-top: 3px; }
.sel-todas { width: 16px; height: 16px; accent-color: var(--primary); margin: 0 6px; opacity: .55; cursor: pointer; } .sel-todas:hover { opacity: 1; }
.list-filters { display: flex; align-items: center; gap: 8px; padding: 8px 24px 10px; flex-wrap: wrap; }
.pfilter { display: inline-flex; gap: 4px; }
.pfilter button { border: 0; background: var(--surface-3); border-radius: 999px; padding: 2px 11px; cursor: pointer; font-weight: 650; font-size: 12px; min-height: 28px; display: inline-flex; white-space: nowrap; align-items: center; gap: 5px; color: var(--text-2); transition: background var(--dur), color var(--dur); }
.pfilter button:hover { background: var(--border); }
.pfilter button[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.pfilter button[aria-pressed="true"].p1 { background: var(--p1); color: #fff; } .pfilter button[aria-pressed="true"].p2 { background: var(--p2); color: #fff; }
.pfilter button[aria-pressed="true"].p3 { background: var(--p3); color: #fff; } .pfilter button[aria-pressed="true"].p4 { background: var(--p4); color: #fff; }
.bulkbar { display: none; align-items: center; flex-wrap: wrap; gap: 2px 4px; padding: 6px 24px; background: var(--primary-soft); }
.bulkbar.is-on { display: flex; } .bulkbar .grow { font-weight: 650; color: var(--primary); white-space: nowrap; } .bulkbar .btn { flex: 0 0 auto; white-space: nowrap; }
@container lista (max-width: 520px) { .bulkbar .grow { flex: 1 0 100%; } }
.mlist { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 14px 84px; } /* folga no fim: o aviso flutuante do marcador nao tapa o ultimo item nem o "Carregar mais" */
.mgroup { padding: 18px 12px 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); letter-spacing: .01em; }
.mgroup__n { margin-left: auto; font-weight: 650; font-size: 12px; opacity: .8; }

/* linha: duas linhas por omissao; numa so linha (remetente | assunto + excerto | hora) quando ha largura */
.mrow { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "av from meta" "av body body"; gap: 1px 14px; align-items: center; padding: 10px 14px 10px 18px; min-height: var(--row-h); border-radius: 14px; cursor: pointer; transition: background 100ms; }
.mrow:hover { background: var(--surface-2); } .mrow:hover .mrow__quick { opacity: 1; pointer-events: auto; }
.mrow[aria-selected="true"] { background: var(--primary-soft); }
.mrow.is-focus { box-shadow: inset 0 0 0 2px var(--primary); }
.mrow__dot { position: absolute; left: 6px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: transparent; }
.mrow.is-unread .mrow__dot { background: var(--primary); }
.mrow__av { grid-area: av; position: relative; width: 40px; height: 40px; }
.mrow__check { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); opacity: 0; cursor: pointer; transition: opacity 100ms; }
.mrow__check input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--primary); }
.mrow:hover .mrow__check, .mrow__check:has(input:checked), .mlist:has(input:checked) .mrow__check { opacity: 1; }
.mrow__from { grid-area: from; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mrow__name { font-size: 14.5px; font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow.is-unread .mrow__name, .mrow.is-unread .mrow__subject { font-weight: 700; color: var(--text); }
.mrow__count { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; background: var(--surface-3); border-radius: 6px; padding: 0 6px; line-height: 17px; }
.mrow__body { grid-area: body; display: flex; flex-wrap: wrap; align-items: center; gap: 1px 8px; min-width: 0; font-size: 13.5px; }
.mrow__prio { flex: none; } .mrow__prio .prio { font-size: 10.5px; padding: 0 6px; }
.mrow__subject { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 0; min-width: 0; }
.mrow__clip { color: var(--text-3); font-size: 12px; flex: none; }
.mrow__preview { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 0 100%; min-width: 0; font-size: 12.5px; }
.mrow__preview .ai-ic { color: var(--ai); font-size: 11px; margin-right: 6px; }
.mrow__cat { flex: none; display: none; }
.mrow__meta { grid-area: meta; display: flex; align-items: center; gap: 8px; justify-content: flex-end; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.mrow__flags { display: flex; gap: 6px; align-items: center; color: var(--text-3); font-size: 12px; }
.mrow__flags .reply { color: var(--p2-text); } .mrow__flags .starred { color: #d4a017; }
.mrow__quick { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; opacity: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2px; box-shadow: var(--shadow-2); z-index: 2; }
.mrow:hover .mrow__time, .mrow:hover .mrow__flags { visibility: hidden; }
.compact .mrow__preview { display: none; }
@container lista (max-width: 560px) { #ordem-rotulo { display: none; } .list-toolbar, .list-filters, .bulkbar { padding-left: 16px; padding-right: 16px; } }
@container lista (min-width: 720px) {
  .mrow { grid-template-columns: 40px 230px minmax(0, 1fr) auto; grid-template-areas: "av from body meta"; min-height: 62px; }
  /* duas linhas: assunto (+ etiqueta) em cima, resumo/excerto por baixo */
  .mrow { min-height: 66px; }
  .mrow__body { flex-wrap: wrap; row-gap: 3px; }
  .mrow__subject { flex: 1 1 0; font-size: 14px; } .mrow__cat { display: inline-flex; order: 1; }
  .mrow__preview { flex: 1 0 100%; order: 2; font-size: 13px; }
}
.list-more { padding: 14px; text-align: center; list-style: none; }
.list-skel { padding: 12px 18px; display: grid; gap: 8px; }

.reader { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.reader__empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--text-3); padding: 32px; }
.reader__empty .logo { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 16px; background: linear-gradient(135deg, #2563eb22, #7c3aed22); color: var(--ai); font-size: 30px; }
.reader__empty .shortcuts { display: grid; grid-template-columns: auto auto; gap: 8px 18px; margin-top: 22px; text-align: left; font-size: 12.5px; }
.reader__head { padding: 14px 22px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.reader__title { display: flex; align-items: flex-start; gap: 12px; } .reader__title h1 { font-size: 19px; flex: 1; word-break: break-word; }
.reader__actions { display: flex; align-items: center; gap: 2px; margin-top: 10px; flex-wrap: wrap; }
.reader__actions .sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.reader__scroll { flex: 1; overflow-y: auto; padding: 16px 22px 28px; display: grid; gap: 14px; align-content: start; grid-auto-rows: max-content; }
.back-btn { display: inline-flex; flex: none; } .back-btn .ic-voltar { display: none; }

.aicard { border: 1px solid var(--ai-border); background: linear-gradient(180deg, var(--ai-soft), var(--surface)); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 12px; }
.aicard__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aicard__title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ai); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.aicard__summary { font-size: 14.5px; line-height: 1.5; }
.aicard__why { font-size: 12.5px; color: var(--text-3); display: flex; gap: 8px; align-items: flex-start; }
.aicard__controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.pset { display: inline-flex; gap: 4px; }
.pset button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r); min-height: 32px; padding: 0 11px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); transition: background var(--dur), border-color var(--dur), transform 80ms; }
.pset button:hover { background: var(--surface-3); } .pset button:active { transform: scale(.96); }
.pset button[aria-pressed="true"].p1 { background: var(--p1-soft); border-color: var(--p1); color: var(--p1-text); } .pset button[aria-pressed="true"].p2 { background: var(--p2-soft); border-color: var(--p2); color: var(--p2-text); }
.pset button[aria-pressed="true"].p3 { background: var(--p3-soft); border-color: var(--p3); color: var(--p3-text); } .pset button[aria-pressed="true"].p4 { background: var(--p4-soft); border-color: var(--p4); color: var(--p4-text); }
.conf { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); } .conf .progress { width: 70px; height: 6px; }
.learned { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); font-size: 13px; font-weight: 600; animation: pop .2s var(--ease); }

.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.msg__head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; }
.msg__head:hover { background: var(--surface-2); }
.msg__who { flex: 1; min-width: 0; } .msg__who b { display: block; } .msg__who span { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.msg__date { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.msg__body { padding: 4px 18px 18px; } .msg.is-collapsed .msg__body { display: none; }
.msg__text { white-space: pre-wrap; word-break: break-word; line-height: 1.65; font-size: 14.5px; }
.msg__html { overflow-x: auto; }
.imgbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 0 10px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.msg__acoes { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.atts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.att { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface-2); color: var(--text); text-decoration: none !important; font-size: 13px; } .att:hover { background: var(--surface-3); }
.att i { color: var(--text-3); }
.quickreply { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 14px 16px; display: grid; gap: 10px; }
.quickreply textarea { min-height: 120px; }
.ai-assist { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--ai-soft); border: 1px dashed var(--ai-border); }
.ai-assist .row { gap: 8px; }

/* editor de email: pagina inteira, limpo */
.compose { position: fixed; inset: 0; z-index: 90; background: var(--surface); display: flex; flex-direction: column; animation: rise .18s var(--ease); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.compose__bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; flex: none; }
.cgroup { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; } .cgroup:not(.cgroup--right) { border: 1px solid var(--border); }
.cgroup--right { gap: 6px; }
.cbtn { min-width: 38px; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; font-size: 13px; transition: background var(--dur), color var(--dur); }
.cbtn:hover { background: var(--surface-3); color: var(--text); }
.cbtn--ai { background: var(--ai-soft); color: var(--ai); } .cbtn--ai:hover, .cbtn--ai[aria-pressed="true"] { background: var(--ai); color: #fff; }
.cmin-title { display: none; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cacct { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 10px; cursor: pointer; color: var(--text-3); } .cacct:hover { background: var(--surface-3); }
.cacct__t { display: grid; text-align: right; line-height: 1.2; } .cacct__t b { font-weight: 600; color: var(--text); font-size: 14px; } .cacct__t small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.cacct select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.csend { height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 650; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; transition: filter var(--dur), transform var(--dur); }
.csend:hover { filter: brightness(1.08); } .csend:active { transform: scale(.97); } .csend.is-loading { opacity: .7; pointer-events: none; }
.compose__scroll { flex: 1; overflow-y: auto; }
.compose__page { max-width: 900px; margin: 0 auto; padding: 22px 40px 80px; }
.compose__subject { width: 100%; border: 0; outline: none; background: transparent; font-size: 32px; font-weight: 750; letter-spacing: -.025em; color: var(--text); padding: 6px 0; }
.compose__subject::placeholder, .cline input::placeholder, .compose__text::placeholder { color: var(--text-3); opacity: .65; }
.cline { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid transparent; }
.cline label { width: 34px; color: var(--text-3); font-size: 14px; flex: none; }
.cline input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; min-height: 44px; min-width: 0; color: var(--text); }
.cline:focus-within { border-bottom-color: var(--primary); }
/* o destaque é a linha de baixo; sem anel de foco à volta do campo */
.compose .cline input:focus-visible, .compose__subject:focus-visible, .compose__text:focus-visible { box-shadow: none; border-radius: 0; outline: none; }
.clink { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 6px 8px; border-radius: 8px; } .clink:hover { background: var(--surface-3); color: var(--text); }
.cchips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.cchips__ai { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ai); font-size: 13px; margin-right: 2px; }
.cchip { border: 0; background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 8px 15px; font-size: 14px; cursor: pointer; transition: background var(--dur), color var(--dur); }
.cchip:hover { background: var(--ai-soft); color: var(--ai); } .cchip:disabled { opacity: .5; cursor: progress; }
.cassist { display: flex; gap: 8px; align-items: center; margin: 8px 0 4px; padding: 8px; border-radius: 14px; background: var(--ai-soft); border: 1px solid var(--ai-border); flex-wrap: wrap; }
.cassist input { flex: 1; min-width: 220px; border: 0; outline: none; background: transparent; font-size: 14.5px; padding: 6px 8px; color: var(--text); }
.cassist select { border: 1px solid var(--ai-border); background: var(--surface); border-radius: 10px; min-height: 34px; padding: 0 8px; }
.compose__text { display: block; width: 100%; border: 0; outline: none; background: transparent; margin-top: 14px; min-height: 260px; font-size: 16px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; cursor: text; }
.compose__text:focus-visible { box-shadow: none; }
.compose__text[data-vazio]::before { content: attr(data-ph); color: var(--text-3); opacity: .65; pointer-events: none; position: absolute; }
.compose__text p, .compose__text div { margin: 0 0 .6em; } .compose__text div[data-cit] { margin-top: 1em; }
.compose__text blockquote { margin: .4em 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--border-strong); color: var(--text-3); }
.compose__text ul, .compose__text ol { margin: .3em 0 .6em; padding-left: 26px; } .compose__text li { margin: 0 0 .2em; }
.compose__text a { color: var(--primary); text-decoration: underline; }
/* barra de formatacao: fixa em baixo no editor */
.compose__editor { position: relative; }
.cfmt { position: sticky; bottom: 14px; z-index: 3; display: flex; align-items: center; gap: 2px; width: max-content; max-width: 100%; margin: 14px auto 0; padding: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-3); overflow-x: auto; }
.cfmt__b { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 14px; }
.cfmt__b:hover { background: var(--surface-3); color: var(--text); } .cfmt__b[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }
.cfmt__sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex: none; }
.chint { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.cdrop { display: none; position: absolute; inset: 12px; border: 2px dashed var(--primary); border-radius: 20px; background: color-mix(in srgb, var(--surface) 88%, var(--primary)); place-items: center; align-content: center; gap: 12px; font-size: 18px; font-weight: 650; color: var(--primary); text-align: center; pointer-events: none; }
.cdrop i { font-size: 38px; display: block; margin-bottom: 8px; }
.compose.is-drop .cdrop { display: grid; }
.compose.is-min { inset: auto 24px 0 auto; width: min(360px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: var(--shadow-3); animation: none; cursor: pointer; }
.compose.is-min .compose__scroll, .compose.is-min .cgroup--right, .compose.is-min #cp-min { display: none; }
.compose.is-min .cmin-title { display: block; flex: 1; } .compose.is-min .compose__bar { padding: 8px 10px; } .compose.is-min .grow { display: none; }
.compose__bar .grow { flex: 1; }
/* destinatarios: chips + sugestoes */
.rcpt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px 0; cursor: text; }
.cline .rcpt__in { flex: 1 1 140px; min-width: 120px; min-height: 34px; }
.rchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 4px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 14px; line-height: 1; }
.rchip__av { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; }
.rchip__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.rchip__x { flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; font-size: 11px; display: grid; place-items: center; } .rchip__x:hover { background: var(--border); color: var(--text); }
.rchip.is-bad { background: var(--p1-bg, #fde8e8); color: var(--p1-text, #b42318); } .rchip.is-bad .rchip__av { background: transparent; color: inherit; }
.recipient-hints { position: absolute; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-3); width: min(420px, 100%); padding: 6px; top: calc(100% + 2px); left: 46px; max-height: 320px; overflow-y: auto; }
.recipient-hints button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; background: transparent; border: 0; border-radius: 10px; cursor: pointer; color: var(--text); min-height: 44px; } .recipient-hints button:hover, .recipient-hints button[aria-selected="true"] { background: var(--primary-soft); }
.rh__t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; } .rh__t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rh__t .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attlist { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
@media (max-width: 800px) { .compose__page { padding: 14px 18px 60px; } .compose__subject { font-size: 24px; } .cbtn--ai span, .csend span, .cacct__t small { display: none; } .compose__bar { padding: 8px 10px; gap: 4px; } .cacct__t b { font-size: 12.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; } .cline label { width: 30px; } }

/* ---------------------------------------------------------------- modal, toast, paleta */
.modal-back { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: grid; place-items: start center; padding: 10vh 16px 16px; animation: fade .15s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); width: min(560px, 100%); animation: pop .18s var(--ease); }
.modal--wide { width: min(760px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); } .modal__body { padding: 20px; } .modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.palette { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-3); overflow: hidden; animation: pop .16s var(--ease); }
.palette input { width: 100%; border: 0; outline: none; padding: 16px 20px; font-size: 16px; background: transparent; border-bottom: 1px solid var(--border); }
.palette__list { max-height: 380px; overflow-y: auto; padding: 6px; }
.palette__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: transparent; border-radius: var(--r); cursor: pointer; text-align: left; min-height: 40px; }
.palette__item[aria-selected="true"] { background: var(--primary-soft); color: var(--primary); } .palette__item i { width: 18px; text-align: center; color: var(--text-3); } .palette__item kbd { margin-left: auto; }
.palette__group { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 300; width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--text); color: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-2); animation: rise .22s var(--ease); }
.toast i { font-size: 15px; } .toast.ok i { color: #4ade80; } .toast.err i { color: #ff8e8e; } .toast.ai i { color: #c4b0ff; }
.toast button { margin-left: auto; border: 0; background: transparent; color: #8fb3ff; font-weight: 700; cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm); } .toast button:hover { background: rgb(255 255 255 / .12); }
[data-theme="dark"] .toast button { color: #1d4ed8; }

/* ---------------------------------------------------------------- login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth__visual { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 10% 0%, #3b5bdb 0%, transparent 60%), radial-gradient(800px 500px at 100% 100%, #7c3aed 0%, transparent 55%), #0b1230; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth__visual h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; max-width: 520px; } .auth__visual p { color: #cdd6f7; max-width: 480px; font-size: 16px; }
.auth__feat { display: grid; gap: 14px; margin-top: 10px; } .auth__feat div { display: flex; gap: 14px; align-items: flex-start; color: #dfe5fb; } .auth__feat i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgb(255 255 255 / .12); flex: none; }
.auth__mock { margin-top: 12px; border-radius: 16px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .16); padding: 14px; display: grid; gap: 8px; max-width: 520px; backdrop-filter: blur(6px); }
.auth__mock div { display: flex; align-items: center; gap: 10px; background: rgb(255 255 255 / .08); padding: 9px 12px; border-radius: 10px; font-size: 13.5px; } .auth__mock b { margin-left: auto; font-size: 12px; opacity: .8; }
.auth__panel { display: grid; place-items: center; padding: 32px; background: var(--surface); } .auth__box { width: min(380px, 100%); }
.auth__box h2 { font-size: 26px; margin: 18px 0 6px; } .auth__box .muted { margin-bottom: 24px; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1280px) { :root { --list-w: 360px; --side-w: 216px; } .brand { min-width: 0; } }
@media (max-width: 1100px) {
  .charts .c4, .charts .c5, .charts .c6, .charts .c7, .charts .c8 { grid-column: span 12; }
  .topbar__search kbd { display: none; } .nav-tabs a span { display: none; } .nav-tabs a { padding: 0 11px; }
}
@media (max-width: 800px) {
  :root { --topbar-h: 52px; }
  .mail, .mail:has(.reader__empty) { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mail.show-side .sidebar { display: flex; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 40; width: min(300px, 86vw); box-shadow: var(--shadow-3); }
  .reader { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 35; transform: translateX(100%); transition: transform .22s var(--ease); } .mail.show-reader .reader { transform: none; }
  .menu-toggle { display: inline-flex !important; }
  .back-btn .ic-voltar { display: inline; } .back-btn .ic-fechar { display: none; } .topbar .ia-status span, .topbar .brand span.t { display: none; } .grid-2 { grid-template-columns: 1fr; }
  .topbar--mail { padding-left: 12px; } .topbar--mail .brand { width: auto; background: transparent; padding: 0; margin: 0; } .topbar--mail .brand b { color: var(--primary); }
  .list-toolbar { padding: 14px 14px 4px; } .list-filters { padding: 6px 14px 8px; } .mlist { padding: 0 6px 84px; } .bulkbar { padding: 6px 14px; }
  .btn, .side-item, .menu button, .menu a { min-height: 44px; } .btn--sm { min-height: 36px; }
  .auth { grid-template-columns: 1fr; } .auth__visual { display: none; } .page { padding: 16px 12px 40px; } .nav-tabs { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
@media print { .topbar, .sidebar, .listpane, .reader__actions, .msg__acoes, .quickreply, .aicard { display: none !important; } .mail { display: block; } }

/* Ficha do remetente (leitor) */
.ficha { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-lg); padding: 9px 14px; font-size: 13px; }
.ficha summary, .ficha__resumo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.ficha__resumo { cursor: default; }
.ficha summary::-webkit-details-marker { display: none; }
.ficha summary > i:first-child, .ficha__resumo > i:first-child { color: var(--text-3); }
.ficha__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ficha__seta { margin-left: auto; color: var(--text-3); transition: transform var(--dur) var(--ease); }
.ficha[open] .ficha__seta { transform: rotate(180deg); }
.ficha__corpo { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
@media print { .ficha { display: none; } }
.avisos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.avisos li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.avisos li i { color: var(--warn); margin-top: 3px; }
.ficha__chips .chip, .ficha__chips .badge { flex: 0 0 auto; white-space: nowrap; }
.ficha__corpo { overflow-wrap: anywhere; }

/* Mensagem reencaminhada no editor (pre-visualizacao) */
.cfwd { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 12px; display: grid; gap: 10px; }
.cfwd__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.6; }
.cfwd__corpo { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); }
.cfwd__anexos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cfwd__anexos .att { cursor: pointer; }

/* Marcador de leitura: barra arrastavel que separa o que ja vi do que falta ver */
.mmarca { display: flex; align-items: center; gap: 10px; height: 44px; margin: 0 -2px; padding: 0 4px; list-style: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: var(--radius-sm, 8px); }
.mmarca:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.mmarca__linha { flex: 1; height: 2px; background: var(--primary); border-radius: 2px; opacity: .55; }
.mmarca__grip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 2px 8px rgba(37, 99, 235, .35); }
.mmarca__grip b { font-weight: 700; } .mmarca__sep { opacity: .6; }
.mmarca__x { flex: 0 0 auto; color: var(--text-3); }
.mmarca.is-arrastar { cursor: grabbing; position: relative; z-index: 2; } .mmarca.is-arrastar .mmarca__linha { opacity: 1; height: 3px; } .mmarca.is-arrastar .mmarca__grip { transform: scale(1.06); box-shadow: 0 6px 18px rgba(37, 99, 235, .45); }
.mlist.a-arrastar { cursor: grabbing; scroll-snap-type: none; } .mlist.a-arrastar .mrow { pointer-events: none; }
.marca-aviso { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 5; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.marca-aviso[hidden] { display: none; } .marca-aviso:hover { filter: brightness(1.08); } .marca-aviso:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .mmarca.is-arrastar .mmarca__grip { transform: none; } }

/* Assinatura HTML por conta: editor em Contas e pre-visualizacao ao escrever */
.ass-ed { margin-top: 8px; } .ass__area { min-height: 130px; margin-top: 0; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r); font-size: 14px; line-height: 1.5; background: var(--surface); }
.ass-ed .cfmt { position: static; margin: 8px 0 0; } .ass__area img { max-width: 100%; height: auto; } .ass__area table { border-collapse: collapse; }
.ass__html { margin-top: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.45; }
.csig { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r); } .csig[hidden] { display: none; }
.csig__t { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.csig__corpo { margin-top: 8px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; } .csig__corpo img { max-width: 100%; height: auto; } .csig:has(input:not(:checked)) .csig__corpo { opacity: .35; }
