/* ============================ Fontes (locais) ============================ */
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url(vendor/fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url(vendor/fonts/instrument-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url(vendor/fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 400; font-display: swap; src: url(vendor/fonts/newsreader-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 500; font-display: swap; src: url(vendor/fonts/newsreader-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(vendor/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(vendor/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); }

/* ============================ Tokens ============================ */
:root {
  color-scheme: light;
  --paper: #f4f5f7;      /* fundo do app */
  --sheet: #ffffff;      /* superfícies */
  --sheet-2: #f9fafb;    /* superfície recuada */
  --ink: #17202c;        /* texto principal */
  --ink-2: #4b5565;      /* texto secundário */
  --ink-3: #7b8493;      /* texto apagado */
  --rule: #e3e6eb;
  --rule-2: #d3d8df;
  --accent: #2350d6;     /* azul postal */
  --accent-ink: #ffffff;
  --accent-soft: #e9eefc;
  --ok: #0f8a5f;  --ok-soft: #e3f4ec;
  --warn: #a8600b; --warn-soft: #fbf0dd;
  --bad: #c42b25; --bad-soft: #fbe7e5;
  --live: #12a150;
  --selected: #eef2fd;
  --shadow: 0 1px 2px rgba(23, 32, 44, .06), 0 8px 24px rgba(23, 32, 44, .06);
  --av-l: 90%; --av-ink: 32%;

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --rail: 236px;
  --list: 388px;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111418; --sheet: #171b21; --sheet-2: #1c2128;
  --ink: #e7eaee; --ink-2: #b2b9c4; --ink-3: #848d9a;
  --rule: #262c35; --rule-2: #333a45;
  --accent: #86a6ff; --accent-ink: #0d1424; --accent-soft: #1c2742;
  --ok: #4cc893; --ok-soft: #14291f; --warn: #e9b155; --warn-soft: #2d2414; --bad: #ff8a80; --bad-soft: #321b1a;
  --live: #3ad07c; --selected: #1d2537;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .3);
  --av-l: 26%; --av-ink: 82%;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --paper: #111418; --sheet: #171b21; --sheet-2: #1c2128;
    --ink: #e7eaee; --ink-2: #b2b9c4; --ink-3: #848d9a;
    --rule: #262c35; --rule-2: #333a45;
    --accent: #86a6ff; --accent-ink: #0d1424; --accent-soft: #1c2742;
    --ok: #4cc893; --ok-soft: #14291f; --warn: #e9b155; --warn-soft: #2d2414; --bad: #ff8a80; --bad-soft: #321b1a;
    --live: #3ad07c; --selected: #1d2537;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .3);
    --av-l: 26%; --av-ink: 82%;
  }
}

/* ============================ Base ============================ */
*, *::before, *::after { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--accent); font-weight: 500; }
a.link:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: .92em; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.icon { flex: none; display: block; }
.quiet { color: var(--ink-3); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bad-ink { color: var(--bad); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================ Controles ============================ */
input, select, textarea {
  font: inherit; color: inherit; width: 100%;
  background: var(--sheet); border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  padding: 8px 10px; transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.55; }
textarea.mono { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 13.5px/1 var(--sans); color: var(--ink); white-space: nowrap;
  background: var(--sheet); border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  padding: 8px 12px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--sheet-2); border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sheet-2); border-color: var(--rule); }
.btn.danger { color: var(--bad); }
.btn.danger:not(.ghost) { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.icon { padding: 7px; }
.btn.icon.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.field { display: grid; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.hint { color: var(--ink-3); font-size: 12px; }
.form { display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span2 { grid-column: 1 / -1; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.row-start { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; }
.form-error { color: var(--bad); font-size: 13px; }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; font-size: 13.5px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 34px; height: 20px; border-radius: 99px; background: var(--rule-2); position: relative; transition: background .2s; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(14px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle.small { font-size: 12.5px; font-weight: 400; color: var(--ink-2); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--sheet-2); color: var(--ink-2); border: 1px solid var(--rule);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.plain { background: transparent; }
.chip.plain.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: transparent; }
.chip.plain.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: transparent; }
.chip.big { height: 30px; padding: 0 12px; font-size: 13px; cursor: pointer; }
.chip.big.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
a.chip:hover { border-color: var(--ink-3); }

.avatar {
  --h: 212;
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  background: hsl(var(--h) 45% var(--av-l)); color: hsl(var(--h) 50% var(--av-ink));
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

.proto { width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center; flex: none; background: var(--sheet-2); color: var(--ink-2); border: 1px solid var(--rule); }
.proto.lg { width: 48px; height: 48px; border-radius: 12px; }
.proto.p-submission { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.proto.p-imap { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.proto.p-smtp-mx { color: var(--warn); background: var(--warn-soft); border-color: transparent; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; margin-top: 5px; }
.status-dot.ok { background: var(--ok); } .status-dot.warn { background: var(--warn); } .status-dot.bad { background: var(--bad); }
.status-dot.lg { width: 14px; height: 14px; margin: 0 4px; }

.meter { display: block; height: 4px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.meter.hot span { background: var(--warn); }
.meter.lg { height: 8px; margin-bottom: 6px; }

/* Indicador "ao vivo": o único movimento contínuo da interface. */
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--live); position: relative; display: inline-block; flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--live); opacity: 0; animation: ping 2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }

/* ============================ Login ============================ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); display: grid; gap: 16px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 22px; margin-top: 4px; }
.seal { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.seal.small { width: 32px; height: 32px; border-radius: 9px; }

/* ============================ Estrutura ============================ */
.app { display: grid; grid-template-columns: var(--rail) var(--list) minmax(0, 1fr); height: 100vh; overflow: hidden; }
.app.single { grid-template-columns: var(--rail) minmax(0, 1fr); }
.pane { min-width: 0; min-height: 0; overflow: auto; }
.pane.list { display: flex; flex-direction: column; overflow: hidden; background: var(--sheet); border-right: 1px solid var(--rule); }
.pane.reader { background: var(--sheet); }
.app:not(.single) .pane.reader { background: var(--paper); }

/* ---- Menu lateral ---- */
.rail { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--rule); padding: 14px 10px; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.rail-brand-text { min-width: 0; display: grid; }
.rail-brand-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-line { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.live-line i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); }
.live-line.off i { background: var(--warn); }
.rail-scroll { flex: 1; overflow: auto; }
.rail-group { margin-bottom: 14px; }
.rail-label { font-size: 12px; color: var(--ink-3); padding: 6px 10px 4px; }
.rail-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; margin: 1px 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2);
  font: 500 13.5px/1.2 var(--sans); cursor: pointer; text-align: left;
}
.rail-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.rail-item.on { background: var(--sheet); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 1px 2px rgba(0,0,0,.04); }
.rail-item.on .icon { color: var(--accent); }
.rail-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-badge { font-size: 11.5px; font-weight: 600; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--rule); color: var(--ink-2); }
.rail-badge.live { background: var(--ok-soft); color: var(--ok); }
.rail-badge.warn { background: var(--warn-soft); color: var(--warn); }
.rail-foot { border-top: 1px solid var(--rule); padding-top: 8px; }
.tabbar, .sheet-backdrop { display: none; }

/* ---- Coluna de lista ---- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; }
.list-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.count { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.list-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; border-bottom: 1px solid var(--rule); }
.list-head + .list-body { border-top: 1px solid var(--rule); }
.search { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: var(--r-sm); background: var(--sheet-2); color: var(--ink-3); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--sheet); }
.search input { border: 0; background: transparent; padding: 8px 0; box-shadow: none !important; }
.seg { display: inline-flex; flex: 1; background: var(--sheet-2); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 2px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--ink-2); font: 500 13px/1 var(--sans); padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.seg button.on { background: var(--sheet); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 1px 2px rgba(0,0,0,.06); }
.more-filters { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; background: var(--sheet-2); border: 1px solid var(--rule); border-radius: var(--r); }
.more-filters .row-end { grid-column: 1 / -1; }

.list-body { flex: 1; overflow: auto; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--rule); position: relative; }
.row:hover { background: var(--sheet-2); }
.row.on { background: var(--selected); }
.row.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.row.muted { opacity: .62; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.row-top strong { font-weight: 600; font-size: 13.5px; }
.row-top time, .since { font-size: 12px; color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }
.row-subject { color: var(--ink); font-size: 13.5px; }
.row-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); min-width: 0; flex-wrap: wrap; }
.dir-tag { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.dir-tag.saida { color: var(--accent); }
.dir-tag.entrada { color: var(--ok); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-2); align-self: center; flex: none; }
.activity-dot.hot { background: var(--live); box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 18%, transparent); }
.list-foot { padding: 12px 16px; }

.empty { padding: 40px 28px; display: grid; justify-items: center; gap: 10px; text-align: center; color: var(--ink-3); }
.empty p { max-width: 34ch; }
.empty-line { color: var(--ink-3); padding: 10px 0; font-size: 13.5px; list-style: none; }

/* ---- Coluna de leitura ---- */
.reader-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-3); text-align: center; padding: 32px; }
.reader-empty p { max-width: 36ch; }
.reader-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 20px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); min-height: 52px; }
.reader-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.back { display: none; }
.reader-bar.bare { display: none; }

.letter, .detail {
  margin: 20px auto 40px; width: calc(100% - 40px); max-width: 860px; background: var(--sheet); border: 1px solid var(--rule);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 28px 32px; display: grid; gap: 20px;
}
.detail.narrow { max-width: 560px; }

/* Mensagem aberta */
.letter-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.letter-titles { display: grid; gap: 16px; min-width: 0; }
.subject { font: 600 22px/1.3 var(--sans); letter-spacing: -.015em; color: var(--ink); overflow-wrap: anywhere; }
.subject.sm { font-size: 22px; }
.people { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.people p { overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }

/* Carimbo postal: o elemento de destaque do painel. */
.postmark { margin: -6px -10px 0 0; flex: none; transform: rotate(-7deg); --stamp: var(--ink-3); color: var(--stamp); }
.postmark.ok { --stamp: var(--accent); }
.postmark.bad { --stamp: var(--bad); }
.postmark svg { display: block; overflow: visible; }
.pm-ring { fill: none; stroke: currentColor; stroke-width: 2.4; opacity: .9; }
.pm-ring.thin { stroke-width: 1; opacity: .6; }
.pm-waves path { fill: none; stroke: currentColor; stroke-width: 2.2; opacity: .55; stroke-linecap: round; }
.postmark text { fill: currentColor; font-family: var(--mono); }
.pm-arc { font-size: 8px; letter-spacing: .16em; font-weight: 500; }
.pm-checks { font-size: 8px; letter-spacing: .06em; font-weight: 600; }
.pm-checks .fail { font-weight: 700; text-decoration: line-through; }
.pm-day { font: 600 17px/1 var(--sans) !important; letter-spacing: .04em; }
.pm-year { font-size: 8.5px; letter-spacing: .08em; opacity: .85; }

.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; color: var(--ink-3); font: 500 13.5px/1 var(--sans); padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .push { margin-left: auto; padding: 0 4px 0 12px; white-space: nowrap; }
.tabs .short { display: none; }

.paper { border: 1px solid var(--rule); border-radius: var(--r); background: #fff; overflow: auto; resize: vertical; height: 460px; min-height: 160px; }
.paper.short { height: 260px; }
.paper iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.paper.text { height: auto; max-height: 560px; resize: none; padding: 18px 20px; font: 14px/1.65 var(--sans); background: var(--sheet-2); color: var(--ink); }
.headers { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 12.5px; background: var(--sheet-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; max-height: 460px; overflow: auto; }
.headers dt { font-family: var(--mono); color: var(--ink-3); }
.headers dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }

.section { display: grid; gap: 10px; }
.section > .btn, .form > .toggle { justify-self: start; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 280px; padding: 8px 12px 8px 8px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); cursor: pointer; color: var(--ink); text-align: left; font: inherit; }
.file:hover { border-color: var(--ink-3); }
.file > span:nth-child(2) { display: grid; min-width: 0; }
.file-ext { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 600 10.5px/1 var(--mono); flex: none; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline > li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.timeline > li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--rule); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-3); background: var(--sheet); margin-top: 4px; }
.timeline .ok .tl-dot { border-color: var(--ok); background: var(--ok); }
.timeline .warn .tl-dot { border-color: var(--warn); }
.timeline .bad .tl-dot { border-color: var(--bad); background: var(--bad); }
.timeline p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.err-box { margin-top: 6px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad); font-size: 12.5px; border: 1px solid color-mix(in srgb, var(--bad) 22%, transparent); }

/* Detalhes genéricos */
.detail-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-head h2 { font-size: 20px; overflow-wrap: anywhere; }
.kv { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.kv > div { padding: 12px 14px; display: grid; gap: 2px; box-shadow: -1px -1px 0 var(--rule); }
.kv dt { font-size: 12px; color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; display: flex; flex-wrap: wrap; gap: 4px; }

.feed { list-style: none; margin: 0; padding: 4px 0; max-height: 380px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet-2); }
.feed li { display: grid; grid-template-columns: 76px 112px 1fr; gap: 10px; align-items: baseline; padding: 6px 14px; font-size: 13px; transition: background 1.2s; }
.feed li.fresh { background: var(--accent-soft); transition: none; }
.feed time { color: var(--ink-3); font-size: 12px; }
.feed .kind { font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.feed .kind.accent { color: var(--accent); }
.feed .kind.strong { color: var(--ink); }
.feed .what { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); min-width: 0; }
.mini-row:first-of-type { border-top: 0; }
.block .block-head + .mini-row, .block .block-head + .empty-line { border-top: 0; }
a.mini-row:hover strong { color: var(--accent); }
.mini-row .grow { display: grid; min-width: 0; }
.mini-row .grow strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .grow small { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .dir { color: var(--ink-3); }
.count-pill { min-width: 28px; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 12px; display: grid; place-items: center; }

/* Conta */
.inbox { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.inbox-row { width: 100%; display: grid; grid-template-columns: 10px minmax(120px, 200px) 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; background: var(--sheet); border: 0; border-top: 1px solid var(--rule); color: var(--ink-2); font: inherit; text-align: left; cursor: pointer; }
.inbox-row:first-child { border-top: 0; }
.inbox-row:hover { background: var(--sheet-2); }
.inbox-row.unread { color: var(--ink); }
.inbox-row.unread strong { font-weight: 600; }
.inbox-row strong { font-weight: 500; }
.inbox-row time { font-size: 12px; color: var(--ink-3); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; }
.inbox-row.unread .unread-dot { background: var(--accent); }
.inbox .empty-line { padding: 14px; }
.stack { display: grid; gap: 12px; justify-items: start; }
.stack > * { justify-self: stretch; }
.stack > .btn { justify-self: start; }

.rules { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r); }
.rules li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--rule); }
.rules li:first-child { border-top: 0; }
.rules b { font-weight: 600; }
.rules code { background: var(--sheet-2); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 6px; }
.rules .empty-line { padding: 14px; }
.rule-form { padding: 16px; border: 1px dashed var(--rule-2); border-radius: var(--r); }
.sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sentence select, .sentence input { width: auto; flex: 1 1 140px; }
.sentence > span { color: var(--ink-2); }

.secret { padding: 14px 16px; border-radius: var(--r); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); display: grid; gap: 8px; }
.copy-line { display: flex; gap: 8px; align-items: center; }
.copy-line code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 6px 10px; }
.keys { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r); }
.keys li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--rule); color: var(--ink-2); }
.keys li:first-child { border-top: 0; }
.keys li strong { color: var(--ink); }
.keys li.muted { opacity: .6; }
.keys .empty-line { padding: 14px; }
.chips-line { display: flex; gap: 6px; flex-wrap: wrap; }

/* DNS */
.dns { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.dns li { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: start; padding: 14px; border-top: 1px solid var(--rule); border-left: 3px solid transparent; }
.dns li:first-child { border-top: 0; }
.dns li.ok { border-left-color: var(--ok); }
.dns li.bad { border-left-color: var(--bad); }
.dns li.warn { border-left-color: var(--warn); }
.dns-type { font: 600 12px/1 var(--mono); padding: 6px 0; text-align: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.dns-body { display: grid; gap: 4px; min-width: 0; }
.dns .name { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.dns-value { display: block; font-size: 12.5px; background: var(--sheet-2); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 6px 8px; overflow-wrap: anywhere; }
.dns .check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.dns li.ok .check { color: var(--ok); } .dns li.bad .check { color: var(--bad); } .dns li.warn .check { color: var(--warn); }

.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-chip span { display: inline-flex; height: 30px; align-items: center; padding: 0 12px; border-radius: 99px; border: 1px solid var(--rule-2); cursor: pointer; font-size: 13px; }
.check-chip input:checked + span { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 500; }
.check-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================ Páginas de coluna única ============================ */
.pane.full { background: var(--paper); }
.page { max-width: 1080px; margin: 0 auto; padding: 28px 32px 56px; display: grid; gap: 20px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.page-head h1 { font-size: 24px; }
.page-head p { margin-top: 2px; }

.health { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid; }
.health.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.health.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }
.health.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); }
.health strong { color: var(--ink); }
.health .icon { margin-top: 1px; }
.health-list { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.health-list a { text-decoration: underline; text-underline-offset: 2px; }
.health .quiet { color: var(--ink-2); }

.stats { margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); }
.stats > div { padding: 16px 18px; border-left: 1px solid var(--rule); }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: 12.5px; color: var(--ink-3); }
.stats dd { margin: 2px 0 0; font-size: 28px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats .bad dd { color: var(--bad); }
.stats .warn dd { color: var(--warn); }

.block { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px 20px; display: grid; align-content: start; gap: 6px; min-width: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.block-head h2 { font-size: 15px; }
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.block .inline-form { margin-top: 8px; }

.bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; height: 150px; align-items: end; padding-bottom: 20px; }
.bar { height: 100%; display: flex; align-items: flex-end; position: relative; }
.bar span { width: 100%; background: var(--accent); border-radius: 3px 3px 1px 1px; opacity: .85; min-height: 2px; }
.bar:hover span { opacity: 1; }
.bar:last-child span { background: var(--live); }
.bar em { position: absolute; bottom: -20px; left: 0; font-style: normal; font-size: 11px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.plain-list { list-style: none; margin: 0; padding: 0 18px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); }
.plain-list li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--rule); min-width: 0; }
.plain-list li:first-child { border-top: 0; }
.plain-list .mono { font-size: 13px; overflow-wrap: anywhere; }
.inline-form.wide { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 12px; }

/* ============================ Avisos ============================ */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r); background: var(--ink); color: var(--paper); font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow); max-width: 380px; animation: rise .2s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ============================ Telas menores ============================ */
@media (max-width: 1280px) {
  :root { --list: 340px; }
  .letter, .detail { margin: 16px auto 32px; width: calc(100% - 32px); padding: 24px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats > div:nth-child(4) { border-left: 0; }
  .stats > div:nth-child(n + 4) { border-top: 1px solid var(--rule); }
}
@media (max-width: 1080px) {
  :root { --rail: 64px; }
  .rail { padding: 14px 8px; align-items: center; }
  .rail-brand-text, .rail-label, .rail-text { display: none; }
  .rail-brand { padding: 4px 0 14px; }
  .rail-item { justify-content: center; padding: 9px; position: relative; }
  .rail-badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .rail-group { margin-bottom: 8px; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
  .letter-head { flex-direction: column-reverse; }
  .postmark { align-self: flex-end; margin: -8px 0 -12px; }
}
@media (max-width: 860px) {
  .app, .app.single { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100dvh; overflow: visible; padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .rail { display: none; }
  .pane { overflow: visible; }
  .pane.list { border-right: 0; min-height: calc(100dvh - 78px - env(safe-area-inset-bottom, 0px)); }
  .list-body { overflow: visible; }
  .app.reading .pane.list { display: none; }
  .app:not(.reading) .pane.reader { display: none; }
  .back { display: inline-flex; }
  .reader-bar.bare { display: flex; }
  .reader-bar { flex-wrap: wrap; padding: 8px 12px; }
  .letter, .detail { margin: 0; width: 100%; border-radius: 0; border-width: 0 0 1px; box-shadow: none; padding: 20px 16px; }
  .subject { font-size: 23px; }
  .postmark { transform: rotate(-7deg) scale(.82); transform-origin: right top; margin-bottom: -26px; }
  .page { padding: 20px 16px 40px; }
  .twin, .grid2, .more-filters { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div { border-left: 0; border-top: 1px solid var(--rule); }
  .stats > div:nth-child(-n + 2) { border-top: 0; }
  .stats > div:nth-child(even) { border-left: 1px solid var(--rule); }
  .stats dd { font-size: 24px; }
  .bars em { font-size: 10px; }
  .feed li { grid-template-columns: 64px 1fr; }
  .feed .what { grid-column: 2; }
  .inbox-row { grid-template-columns: 10px 1fr auto; }
  .inbox-row > span:nth-child(3) { grid-column: 2 / -1; grid-row: 2; }
  .dns li { grid-template-columns: 1fr; }
  .dns-type { justify-self: start; padding: 6px 10px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form > * { flex: 1 1 100%; }
  .page-head .btn { display: none; }
  .tabs .long { display: none; }
  .tabs button { padding: 10px 9px; }
  .tabs .short { display: inline; }
  .toasts { left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: auto; background: var(--sheet); border-top: 1px solid var(--rule); padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: var(--ink-3); font: 500 11px/1 var(--sans); cursor: pointer; }
  .tabbar .on { color: var(--accent); }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); }
  .sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--sheet); border-radius: 16px 16px 0 0; padding: 12px 12px calc(28px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 2px; align-content: start; max-height: min(80dvh, 640px); overflow: auto; }
  .sheet .rail-item { justify-content: flex-start; position: static; padding: 12px; font-size: 15px; text-align: left; }
  .sheet .rail-text { display: block; }
  .sheet .rail-badge { position: static; min-width: 20px; height: 18px; font-size: 11.5px; padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Operação: entrega por domínio, DKIM ---------- */
.warn-ink { color: var(--warn); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.delegate-new { display: flex; gap: 8px; margin-top: 10px; }
.delegate-new input { flex: 1; min-width: 0; }
.dstats { display: grid; font-size: 14px; }
.dstats-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.dstats-row:first-child { border-top: 0; }
.dstats-row.head { font-size: 12px; color: var(--ink-3); padding-top: 0; }
.dstats-row strong { font-weight: 500; }
.rate { position: relative; display: flex; align-items: center; gap: 8px; }
.rate i { display: block; height: 6px; border-radius: 99px; background: var(--ok); max-width: 60%; flex: none; }
.rate.warn i { background: var(--warn); } .rate.bad i { background: var(--bad); }
.rate b { font-weight: 500; font-size: 13px; }
.rate.bad b { color: var(--bad); } .rate.warn b { color: var(--warn); }
@media (max-width: 640px) {
  .dstats-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .dstats-row > :nth-child(3), .dstats-row > :nth-child(4), .rate i { display: none; }
  .dkim-row { flex-wrap: wrap; }
  .dkim-row .grow { flex: 1 1 60%; }
}
.dkim-chip { min-width: 92px; justify-content: center; text-align: center; }

/* ---------- Login, administradores e minha conta ---------- */
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; justify-self: center; }
.link-btn:hover { text-decoration: underline; }
.otp { font-family: var(--mono, ui-monospace, monospace); font-size: 20px; letter-spacing: .3em; text-align: center; }
.me-item { min-height: 48px; }
.me-text { display: grid; line-height: 1.25; min-width: 0; }
.me-text strong { font-weight: 500; }
.me-text small { color: var(--ink-3); font-size: 12px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); text-decoration: none; }
.notice > svg { color: var(--accent); flex: none; margin-top: 2px; }
.notice.plain { background: var(--sheet); border-color: var(--rule); margin: 0; }
a.notice:hover { border-color: var(--accent); }
.narrow-page { max-width: 720px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
.block-head + .admin-row, .empty-line + .admin-row { border-top: 0; }
.admin-row .grow { display: grid; min-width: 0; }
.admin-row .grow strong { font-weight: 500; }
.admin-row .grow small { color: var(--ink-3); font-size: 12.5px; }
.admin-row select { width: auto; }
.row-menu { display: flex; gap: 4px; }
.admin-pw { grid-column: 2 / -1; margin-top: 0 !important; }
.totp-setup { display: flex; gap: 24px; align-items: flex-start; }
.qr { width: 180px; height: 180px; border-radius: 10px; border: 1px solid var(--rule); background: #fff; padding: 6px; flex: none; image-rendering: pixelated; }
.totp-steps { display: grid; gap: 12px; min-width: 0; }
.totp-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.secret { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 6px; background: var(--paper, var(--rule)); font-size: 13.5px; word-break: break-all; user-select: all; }
@media (max-width: 760px) {
  .form-row { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .admin-row > .chip { display: none; }
  .row-menu { grid-column: 1 / -1; flex-wrap: wrap; }
  .admin-pw { grid-column: 1 / -1; }
  .totp-setup { flex-direction: column; align-items: center; }
}
.block .form > .btn { justify-self: start; }

/* ---------- Listas e campanhas ---------- */
.member-tools { display: grid; gap: 10px; }
.member-tools .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form.wrap input { min-width: 180px; }
.code-box { margin: 0; padding: 12px 14px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--rule); font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.camp { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.camp + .camp { margin-top: 8px; }
.camp.open { border-color: var(--rule-2); box-shadow: var(--shadow); }
.camp-head { width: 100%; display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: transparent; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.camp-head:hover { background: var(--paper); }
.camp-head .grow { display: grid; min-width: 0; flex: 1; }
.camp-head strong { font-weight: 500; }
.camp-num { display: grid; text-align: right; line-height: 1.2; }
.camp-num b { font-weight: 600; font-variant-numeric: tabular-nums; }
.camp-num small { color: var(--ink-3); font-size: 11.5px; }
.camp-body { padding: 4px 14px 14px; display: grid; gap: 12px; border-top: 1px solid var(--rule); padding-top: 14px; }
.progress { height: 6px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.count-pill.ok { background: var(--ok-soft); color: var(--ok); }
.links-top .mini-row { padding: 6px 0; }
.member-tools + .mini-row { border-top: 0; }

/* ---------- Postmaster (relatórios DMARC) ---------- */
.pm-head { flex-wrap: wrap; }
.pm-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pm-controls select { width: auto; min-width: 180px; }
.pm-controls .seg { flex: none; }
.advice { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.advice li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--sheet); font-size: 14px; }
.advice li > svg { flex: none; margin-top: 2px; }
.advice li.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.advice li.ok > svg { color: var(--ok); }
.advice li.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.advice li.info > svg { color: var(--accent); }
.advice li.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.advice li.warn > svg { color: var(--warn); }
.advice li.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.advice li.bad > svg { color: var(--bad); }
.stats dd.pm-policy { font-family: var(--mono); font-size: 20px; }
.pm-policy small { font-size: 13px; color: var(--ink-3); }
.pm-chart { width: 100%; height: auto; display: block; overflow: visible; }
.pm-grid { stroke: var(--rule); stroke-width: 1; }
.pm-tick { fill: var(--ink-3); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.pm-bar { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.pm-bar:hover { fill: color-mix(in srgb, var(--accent) 38%, transparent); }
.pm-line { fill: none; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.pm-line.dmarc { stroke: var(--ok); stroke-width: 2.5; }
.pm-line.dkim { stroke: var(--accent); stroke-dasharray: 5 4; }
.pm-line.spf { stroke: var(--warn); stroke-dasharray: 2 4; }
.pm-dot.dmarc { fill: var(--ok); }
.pm-dot.dkim { fill: var(--accent); }
.pm-dot.spf { fill: var(--warn); }
.pm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pm-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.pm-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.pm-legend .lg-bar { height: 10px; width: 10px; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.pm-legend .lg-dmarc { background: var(--ok); }
.pm-legend .lg-dkim { background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 8px); }
.pm-legend .lg-spf { background: repeating-linear-gradient(90deg, var(--warn) 0 2px, transparent 2px 5px); }
.pmt { display: grid; font-size: 14px; }
.pmt-row { display: grid; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule); font-variant-numeric: tabular-nums; min-width: 0; }
.pmt-row:first-child { border-top: 0; }
.pmt-row.head { font-size: 12px; color: var(--ink-3); padding-top: 0; }
.pmt-row strong { font-weight: 500; }
.pmt-ip .pmt-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.2fr) repeat(3, minmax(0, .7fr)) minmax(0, 1.3fr); }
.pmt-org .pmt-row { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .pmt-ip .pmt-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pmt-ip .pmt-row > :nth-child(3), .pmt-ip .pmt-row > :nth-child(5), .pmt-ip .pmt-row > :nth-child(6), .pmt-ip .pmt-row > :nth-child(7) { display: none; }
  .pmt-org .pmt-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pmt-org .pmt-row > :nth-child(2) { display: none; }
  .pm-controls { width: 100%; }
  .pm-controls select { flex: 1; }
}

/* ---------- BIMI ---------- */
.bimi-row { border-top: 0; }
.bimi-logo { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--rule); background: #fff; object-fit: contain; flex: none; }
.bimi-problems { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 6px; border-radius: var(--r); background: var(--bad-soft); color: var(--bad); font-size: 13.5px; }
.bimi-problems li { display: flex; gap: 8px; align-items: flex-start; }
.bimi-problems li > svg { flex: none; margin-top: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
label.btn { position: relative; cursor: pointer; }
label.btn.is-disabled { opacity: .5; pointer-events: none; }
label.btn:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }

/* No celular, focar um campo com fonte abaixo de 16px faz o navegador dar zoom. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
}

/* ---------- Barras de rolagem: finas, na cor do tema ---------- */
:root { --scroll-thumb: color-mix(in srgb, var(--ink-3) 38%, transparent); --scroll-thumb-hover: color-mix(in srgb, var(--ink-3) 65%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
::-webkit-scrollbar-corner { background: transparent; }

/* Entrada por webhook */
.inbound-new { display: flex; gap: 8px; margin-top: 10px; }
.inbound-new input { flex: 1; min-width: 0; }
@media (max-width: 600px) { .inbound-new { flex-direction: column; } }
/* Entrega por provedor */
.pstats { display: grid; font-size: 14px; }
.pstats-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 2fr) repeat(3, minmax(0, 92px)); gap: 16px; align-items: center; padding: 11px 0; border-top: 1px solid var(--rule); }
.pstats-row:first-child { border-top: 0; padding-top: 0; }
.pstats-name, .pstats-num { display: grid; gap: 1px; min-width: 0; }
.pstats-name strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstats-num b { font-weight: 500; font-size: 14px; }
.pstats small { font-size: 12px; }
.pstats-bar { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; background: var(--rule); }
.pstats-bar i { display: block; flex: 0 1 0; min-width: 0; }
.pstats-bar .ok { background: var(--ok); }
.pstats-bar .wait { background: var(--warn); }
.pstats-bar .bad { background: var(--bad); }
.ok-ink { color: var(--ok); }
@media (max-width: 760px) {
  .pstats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
  .pstats-name, .pstats-bar { grid-column: 1 / -1; }
}
