/* EproMail — identidad "correo de oficina": papel frío, tinta, pino y lacre.
   Un solo gesto memorable: el filete de correo aéreo. Todo lo demás, quieto. */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --accent: #0e5a4a;
  --accent-hover: #0a4639;
  --accent-soft: rgba(14, 90, 74, 0.1);
  --accent-ring: rgba(14, 90, 74, 0.28);
  --lacra: #be4b21;
  --star: #9a6a0a;
  --text: #1a242e;
  --text-2: #4d5d6b;
  --text-3: #8592a0;
  --bg: #e6eae8;
  --surface: #fbfcfb;
  --surface-2: #eff3f1;
  --hover: rgba(26, 36, 46, 0.055);
  --border: rgba(26, 36, 46, 0.12);
  --danger: #b3271e;
  --ok: #1d6f2e;
  --on-accent: #fff;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow: 0 12px 40px rgba(26, 36, 46, 0.22);
  --airmail: repeating-linear-gradient(135deg, var(--lacra) 0 10px, #fbfcfb 10px 20px, #1d4e89 20px 30px, #fbfcfb 30px 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #6fd3b8; --accent-hover: #8fe0c8; --accent-soft: rgba(111, 211, 184, 0.13);
    --accent-ring: rgba(111, 211, 184, 0.35);
    --lacra: #e88a55;
    --star: #e6b53c;
    --text: #e8eef0; --text-2: #b6c2cb; --text-3: #8494a1;
    --bg: #0f1619; --surface: #161f24; --surface-2: #1b272e;
    --hover: rgba(255, 255, 255, 0.07); --border: rgba(255, 255, 255, 0.11);
    --danger: #ff9d97; --ok: #7ed08a; --on-accent: #0b1512;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #6fd3b8; --accent-hover: #8fe0c8; --accent-soft: rgba(111, 211, 184, 0.13);
  --accent-ring: rgba(111, 211, 184, 0.35);
  --lacra: #e88a55;
  --star: #e6b53c;
  --text: #e8eef0; --text-2: #b6c2cb; --text-3: #8494a1;
  --bg: #0f1619; --surface: #161f24; --surface-2: #1b272e;
  --hover: rgba(255, 255, 255, 0.07); --border: rgba(255, 255, 255, 0.11);
  --danger: #ff9d97; --ok: #7ed08a; --on-accent: #0b1512;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.splash { height: 100vh; display: grid; place-content: center; gap: 12px; text-align: center; font-size: 22px; font-weight: 650; }
.splash img { width: 96px; height: 96px; margin: auto; }

/* ---- controles ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 33px; padding: 0 13px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.icon-btn { display: inline-grid; place-items: center; width: 33px; height: 33px; border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer; color: var(--text-2); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  height: 33px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); outline: none; min-width: 0;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
label.field { display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); }
label.field > input, label.field > select, label.field > textarea, label.field .pw input { font-size: 14px; color: var(--text); }
.pw { position: relative; display: flex; }
.pw input { flex: 1; padding-right: 38px; }
.pw .eye { position: absolute; right: 2px; top: 0; }
label.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.badge { min-width: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--lacra); color: #fff; font-size: 11.5px; font-weight: 650; text-align: center; line-height: 19px; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.error-text { color: var(--danger); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- ingreso ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1100px 500px at 50% -10%, rgba(14, 90, 74, 0.12), transparent 60%), var(--bg); }
.login form { width: min(400px, 100%); display: grid; gap: 13px; padding: 0 30px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.login form::before { content: ""; display: block; margin: 0 -30px 6px; height: 6px; background: var(--airmail); }
.login .brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: 0.005em; margin: 12px 0 2px; }
.login .brand img { width: 42px; height: 42px; border-radius: 10px; }
.login .btn { justify-content: center; height: 38px; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }

/* ---- layout de 3 paneles ---- */
.shell { display: grid; grid-template-columns: var(--w-side, 216px) 4px var(--w-list, 336px) 4px minmax(0, 1fr); height: 100vh; }
.shell.reader-focus { grid-template-columns: 0 0 0 0 minmax(0, 1fr); }
.shell.reader-focus > .side, .shell.reader-focus > .list, .shell.reader-focus > .splitter { display: none; }
.splitter { cursor: col-resize; background: transparent; }
.splitter:hover, .splitter.drag { background: var(--accent-soft); }
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.side { background: var(--surface-2); padding: 0 8px 10px; gap: 10px; position: relative; }
.side::before { content: ""; display: block; height: 5px; margin: 0 -8px 2px; background: var(--airmail); border-radius: 0; }
.list { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

.side-top { display: grid; gap: 10px; padding: 8px 4px 2px; }
.side-brand { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 4px; font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.01em; }
.side-brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.acct-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: pointer; text-align: left; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); transition: border-color 0.12s, box-shadow 0.12s; }
.acct-btn:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.acct-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct-btn .avatar, .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 650; flex: none; }
.acct-btn .who { min-width: 0; flex: 1; }
.acct-btn .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn .who div:first-child { font-weight: 600; color: var(--text); line-height: 1.2; }
.acct-btn .who div + div { margin-top: 2px; font-size: 12px; color: var(--text-3); }
.acct-btn > svg { width: 16px; height: 16px; color: var(--text-3); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.compose-btn { justify-content: center; height: 40px; margin: 0 4px; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.folders { flex: 1; overflow: auto; margin: 0 -4px; padding: 2px 4px 8px; }
.folder { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 5px 10px; border: 0; border-left: 3px solid transparent; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: transparent; cursor: pointer; text-align: left; color: var(--text); }
.folder:hover { background: var(--hover); }
.folder.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; border-left-color: var(--accent); }
.folder .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.folder.active .count { color: var(--accent); }
.folder.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.folders .sep { height: 1px; background: var(--border); margin: 8px 6px; }
.side-foot { display: flex; gap: 2px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 6px; }

/* menú emergente */
.menu { position: fixed; z-index: 50; min-width: 236px; max-width: min(320px, calc(100vw - 16px)); max-height: 70vh; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu .menu-text { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .badge { margin-left: auto; flex: none; }
.menu .sep { height: 1px; background: var(--border); margin: 4px; }
.menu .label { padding: 6px 10px 4px; font-size: 12.5px; color: var(--text-3); }

/* ---- lista ---- */
.list-head { padding: 12px 12px 8px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.list-title { display: flex; align-items: center; gap: 6px; }
.list-title h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { display: flex; gap: 4px; }
.search input { flex: 1; height: 37px; border-radius: var(--r-pill); padding: 0 15px; background: var(--surface-2); }
.toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar .info { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.adv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.adv .full { grid-column: 1 / -1; }
.adv .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.items { flex: 1; overflow: auto; padding: 6px 8px 12px; }
.group-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 4px; width: 100%; margin: 10px 0 4px; padding: 3px 4px 3px 8px; background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--text-2); backdrop-filter: blur(8px); }
.group-head:first-child { margin-top: 2px; }
.group-head.starred { color: var(--star); }
.group-toggle { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; border: 0; padding: 2px 0; background: transparent; color: inherit; font-size: 12.5px; font-weight: 650; letter-spacing: 0.015em; text-align: left; cursor: pointer; }
.group-toggle:hover { color: var(--text); }
.group-toggle svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.12s; }
.group-head.collapsed .group-toggle svg { transform: rotate(-90deg); }
.group-toggle span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-toggle small { color: var(--text-3); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--hover); border-radius: var(--r-pill); padding: 0 8px; line-height: 20px; }
.group-select { width: 26px; height: 26px; color: var(--text-3); }
.group-select svg { width: 16px; height: 16px; }
.group-select:hover { color: var(--accent); background: var(--accent-soft); }
.group-select.on { color: var(--accent); background: var(--accent-soft); }
.item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 10px 14px 10px 12px; margin: 2px 0; border: 1px solid transparent; border-radius: var(--r-md); cursor: pointer; position: relative; transition: background 0.12s, border-color 0.12s; }
.item:hover { background: var(--hover); }
.item.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.item.checked { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.item.unread { background: color-mix(in srgb, var(--lacra) 5.5%, transparent); }
.item.unread::before { content: ""; position: absolute; left: 4px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--lacra); }
.item.unread.active::before, .item.unread.checked::before { left: 3px; }
.item .av { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 650; font-size: 16px; flex: none; }
.item .av input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.item .av::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); opacity: 0; transition: opacity 0.12s; }
.item:hover .av::after, .item.selecting .av::after { opacity: 1; }
.item:hover .av span, .item.selecting .av span { opacity: 0; }
.item.checked .av { background: var(--accent) !important; }
.item.checked .av::after { background: var(--accent); border-color: var(--accent); opacity: 1; }
.item.checked .av span { opacity: 1; }
.item.checked .av span::before { content: "\2713"; }
.item.checked .av span { font-size: 0; }
.item.checked .av span::before { font-size: 18px; position: relative; z-index: 2; }
.item .body { min-width: 0; display: grid; gap: 1px; }
.item .row1, .item .row2 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.item .from { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.item.unread .from, .item.unread .subj { font-weight: 650; }
.item .date { font-size: 12px; color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; }
.item.unread .date { color: var(--lacra); font-weight: 650; }
.item .subj { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.item .snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 13px; }
.item .flags { display: flex; align-items: center; gap: 2px; flex: none; }
.item .flags svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.star { color: var(--text-3); cursor: pointer; }
.star.on { color: var(--star); }
.star.on svg { fill: var(--star); stroke: var(--star); }
.syncbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); padding: 2px 4px; }
.syncbar .spinner { width: 12px; height: 12px; border-width: 2px; }
.syncbar .bar { flex-basis: 100%; height: 3px; border-radius: 2px; background: var(--hover); overflow: hidden; }
.syncbar .bar > div { height: 100%; background: var(--accent); transition: width 0.3s; }
.empty { padding: 44px 18px; text-align: center; color: var(--text-3); display: grid; gap: 6px; justify-items: center; }
.empty::before { content: "✉"; font-size: 26px; opacity: 0.55; }
.more { display: block; width: calc(100% - 24px); margin: 12px; justify-content: center; }

/* ---- lector ---- */
.reader { overflow: hidden; background: var(--surface); min-width: 0; min-height: 0; }
.reader-empty { flex: 1; display: grid; place-content: center; text-align: center; color: var(--text-3); gap: 10px; padding: 24px; max-width: 46ch; margin: auto; }
.reader-empty img { width: 64px; opacity: 0.55; margin: auto; filter: saturate(0.7); }
.reader-bar { display: flex; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface); align-items: center; }
.reader-bar .grow { flex: 1; }
.reader-scroll { flex: 1; overflow: auto; min-height: 0; }
.msg-head { padding: 20px clamp(16px, 3.5vw, 44px) 8px; width: 100%; max-width: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.msg-head h1 { margin: 0 0 14px; font-family: var(--serif); font-size: clamp(20px, 2vw, 27px); letter-spacing: 0; line-height: 1.25; font-weight: 600; word-break: break-word; text-wrap: balance; max-width: 48ch; }
.msg-from { display: flex; gap: 11px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid var(--border); max-width: 90ch; }
.msg-from .meta { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); display: grid; gap: 1px; }
.msg-from .meta strong { color: var(--text); font-size: 14px; }
.msg-from .meta div { word-break: break-word; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px clamp(16px, 3.5vw, 44px) 4px; width: 100%; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; padding: 7px 11px; border: 1px solid var(--border); border-radius: var(--r-pill); text-decoration: none; color: var(--text); background: var(--surface-2); }
.att:hover { background: var(--hover); }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; }
.msg-body { padding: 10px clamp(16px, 3.5vw, 44px) 40px; width: 100%; max-width: none; font-size: 14.5px; line-height: 1.65; }
.msg-body iframe { width: 100%; max-width: 100%; border: 1px solid var(--border); background: #fff; border-radius: var(--r-md); min-height: 62vh; display: block; }
.msg-body pre { white-space: pre-wrap; word-break: break-word; font: inherit; margin: 0; max-width: 80ch; }

/* ---- diálogos ---- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(15, 22, 25, 0.45); display: grid; place-items: center; padding: 16px; animation: overlay-in 0.16s ease-out; }
@keyframes overlay-in { from { opacity: 0; } }
.dialog { width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.dialog::before { content: ""; display: block; height: 5px; background: var(--airmail); }
.dialog.wide { width: min(980px, 100%); }
.dialog > header { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; cursor: move; user-select: none; }
.dialog > header h3 { margin: 0; flex: 1; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.dialog > .body { padding: 4px 16px 16px; overflow: auto; display: grid; gap: 12px; }
.dialog > footer { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.dialog > footer .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
fieldset { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px 12px; margin: 0; display: grid; gap: 10px; }
legend { padding: 0 6px; color: var(--text-2); font-size: 12.5px; }
.note { padding: 9px 11px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 13px; line-height: 1.45; }
.note.err { background: rgba(179, 39, 30, 0.1); color: var(--danger); }

.compose .body { gap: 8px; }
.compose .addr { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 8px; }
.compose .addr span { color: var(--text-2); font-size: 13px; }
.compose textarea.text { min-height: 260px; font-family: var(--font); line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 11px; border-radius: var(--r-pill); background: var(--hover); font-size: 13px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--text-2); }

.rules { display: grid; grid-template-columns: 260px 1fr; gap: 16px; min-height: 420px; }
.rule-list { border-right: 1px solid var(--border); padding-right: 12px; overflow: auto; max-height: 60vh; }
.rule-list button { display: flex; width: 100%; align-items: center; gap: 6px; padding: 8px; border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer; text-align: left; }
.rule-list button:hover { background: var(--hover); }
.rule-list button.active { background: var(--accent-soft); color: var(--accent); }
.rule-list .off { opacity: 0.55; }
.rule-edit { display: grid; gap: 12px; align-content: start; }

table.usage { width: 100%; border-collapse: collapse; font-size: 13px; }
table.usage th, table.usage td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--border); }
table.usage td.n { text-align: right; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); border-radius: 4px; }

#toasts { position: fixed; z-index: 60; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 11px 17px; border-radius: var(--r-md); background: #1d2a33; color: #f2f6f4; box-shadow: var(--shadow); max-width: min(560px, 90vw); font-size: 13.5px; }
.toast.err { background: var(--danger); color: #fff; }

/* ---- SweetAlert2 con la identidad de EproMail ---- */
.swal2-popup { font-family: var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.swal2-popup::before { content: ""; display: block; height: 5px; margin: -1px -1px 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--airmail); }
.swal2-title { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; padding-top: 1em; }
.swal2-html-container { font-size: 14px; }
.swal2-confirm.swal-confirm-ok { background: var(--accent); color: var(--on-accent); }
.swal2-confirm.swal-confirm-danger { background: var(--danger); color: #fff; }
.swal2-confirm:focus-visible, .swal2-cancel:focus-visible, .swal2-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 3px var(--accent-ring); }
.swal2-input { border-radius: var(--r-sm); }
.epromail-toast { border-radius: var(--r-md); }
.epromail-toast::before { display: none; }

/* ---- progreso de operaciones largas (borrados masivos) ---- */
.epromail-progress { min-width: min(420px, 90vw); }
.epromail-progress .ep-progress { height: 10px; border-radius: 5px; background: var(--hover); overflow: hidden; margin: 6px 0 8px; }
.epromail-progress .ep-progress-fill { height: 100%; width: 0; border-radius: 5px; background: var(--accent); transition: width 0.2s ease; }
.epromail-progress .ep-progress-fill.indet { width: 40%; animation: ep-progress-slide 1.1s ease-in-out infinite; }
@keyframes ep-progress-slide { from { margin-left: -40%; } to { margin-left: 100%; } }
.epromail-progress .ep-progress-text { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* scrollbars discretos */
.items, .folders, .reader-scroll { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

@media (max-width: 1280px) {
  .shell { grid-template-columns: var(--w-side, 200px) 4px var(--w-list, 300px) 4px minmax(0, 1fr); }
  .item { padding: 9px 10px 9px 10px; gap: 10px; }
}

/* ---- móvil: un panel a la vez ---- */
.mobile-back { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .splitter { display: none; }
  .shell > .pane { display: none; height: 100vh; }
  .shell[data-view="side"] > .side,
  .shell[data-view="list"] > .list,
  .shell[data-view="reader"] > .reader { display: flex; }
  .mobile-back { display: inline-grid; }
  .rules { grid-template-columns: 1fr; }
  .rule-list { border-right: 0; max-height: 200px; }
  .grid3, .adv { grid-template-columns: 1fr; }
  .msg-head, .atts, .msg-body { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .spinner { animation-duration: 1.2s; }
  .epromail-progress .ep-progress-fill.indet { animation: none; width: 100%; opacity: 0.6; }
}
