:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1c1f24;
  --muted: #5d6470;
  --border: #dde1e7;
  --primary: #256d5a;
  --primary-text: #ffffff;
  --primary-soft: #e3f1ec;
  --danger: #c5362c;
  --shadow: 0 1px 2px rgba(20, 24, 31, .06), 0 4px 16px rgba(20, 24, 31, .06);
  --radius: 14px;

  --c-urgente: #fb4c2f;
  --c-personal: #f691b2;
  --c-sensible: #434343;
  --c-ayto: #2da2bb;
  --c-responder: #fad165;
  --c-clave: #a479e2;
  --c-firmar: #ffad47;
  --c-delegar: #4a86e8;
  --c-leer: #cccccc;
  --c-aspm: #2b6cb0;
  --c-pmsgo: #6b46c1;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181d;
    --surface: #1f2228;
    --surface-2: #272b33;
    --text: #eceef2;
    --muted: #a3aab6;
    --border: #353a44;
    --primary: #4fb394;
    --primary-text: #0f1a16;
    --primary-soft: #1d3a31;
    --danger: #ff7a6e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; white-space: nowrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; padding: 8px 14px; border-radius: 999px;
  color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 600;
}
.tab.active { background: var(--primary-soft); color: var(--primary); }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px; }

@media (max-width: 640px) {
  .brand { display: none; }
  .topbar { padding: 8px 10px; gap: 6px; }
  .tab { padding: 8px 10px; }
}

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 96px; }

/* Login */
.login { display: grid; place-items: center; min-height: 80vh; }
.login-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 24px; max-width: 420px; text-align: center;
}
.login-card h1 { margin: 0 0 8px; font-size: 28px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 600; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.05); background: var(--primary); }
.btn-danger { color: var(--danger); }
.btn-big { width: 100%; font-size: 18px; min-height: 56px; margin: 16px 0 8px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 15px; }

/* Cabecera de vista */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.view-head h2 { margin: 0; font-size: 22px; }
.progress { color: var(--muted); font-weight: 600; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-row input, .filter-row select {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.filter-row input { flex: 1; min-width: 180px; }

/* Tarjeta */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text);
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.from { font-weight: 700; font-size: 18px; }
.meta { color: var(--muted); font-size: 14px; }
.subject { font-size: 20px; font-weight: 700; margin: 6px 0 8px; line-height: 1.3; }
.snippet { color: var(--muted); margin: 0 0 12px; }
.section-title { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }

.original { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.original summary { cursor: pointer; padding: 10px 12px; font-weight: 600; background: var(--surface-2); }
.original iframe { width: 100%; height: 420px; border: 0; background: #fff; display: block; }

.draft {
  border: 2px solid var(--primary); border-radius: 12px; padding: 14px; background: var(--surface);
  min-height: 90px; outline: none; overflow-wrap: anywhere;
}
.draft:focus { box-shadow: 0 0 0 4px var(--primary-soft); }
.draft-meta { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.no-draft { padding: 12px 14px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); }

.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.actions .btn { width: 100%; }
.actions .wide { grid-column: 1 / -1; }
@media (min-width: 640px) { .actions { grid-template-columns: repeat(3, 1fr); } }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; flex-wrap: wrap; }

/* Listas */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; cursor: pointer; }
.row-main .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main .s { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-date { color: var(--muted); font-size: 13px; white-space: nowrap; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 44px; }
.loading { text-align: center; padding: 40px; color: var(--muted); }
.error-box { background: #fde8e6; color: #7a1d15; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
@media (prefers-color-scheme: dark) { .error-box { background: #3a1b18; color: #ffb4ab; } }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); display: grid; place-items: end center; z-index: 50; }
@media (min-width: 640px) { .modal-back { place-items: center; } }
.modal {
  background: var(--surface); width: min(560px, 100%); max-height: 90vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) { .modal { border-radius: 18px; } }
.modal h3 { margin: 0 0 12px; }
.modal textarea { width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.modal .opts { display: grid; gap: 8px; margin: 12px 0; }
.modal .opt { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.modal .opt input { width: 20px; height: 20px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal input[type=date] { min-height: 48px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }

/* Aviso inferior */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #22262d; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: center; z-index: 60; max-width: calc(100% - 32px);
}
.toast button { background: none; border: 0; color: #8fe0c5; font-weight: 700; cursor: pointer; }

/* Adjuntos recibidos */
.adj-list { display: grid; gap: 6px; }
.adj { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px 4px 4px; background: var(--surface); }
.adj-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 6px; text-align: left; border-radius: 8px; }
.adj-main:hover { background: var(--surface-2); }
.adj-ico { font-size: 20px; }
.adj-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.adj-size { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Adjuntar archivos */
.draft-adj, #c-adj { margin-top: 10px; }
.adj-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.adj-edit:empty { display: none; }
.adj-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 14px; }
.adj-pill .adj-name { max-width: 220px; }
.adj-pill button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 999px; }
.adj-pill button:hover { background: var(--border); }
.adj-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.danger { color: var(--danger); font-weight: 600; }
.drop { outline: 3px dashed var(--primary); outline-offset: -3px; }

/* Ventanas grandes: visor y redactor */
.modal.big { width: min(900px, 100%); }
@media (max-width: 639px) { .modal.big { max-height: 96vh; height: 96vh; } }
.visor-head { display: flex; align-items: baseline; gap: 10px; }
.visor-head h3 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visor { background: var(--surface-2); border-radius: 10px; min-height: 200px; overflow: hidden; }
.visor iframe { width: 100%; height: 68vh; border: 0; background: #fff; display: block; }
.visor img, .visor video { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto; }
.visor audio { width: 100%; margin: 24px 0; }

.comp-head { display: flex; align-items: center; justify-content: space-between; }
.comp-head h3 { margin: 0; }
.comp-fields { display: grid; gap: 8px; margin: 12px 0; }
.comp-fields label { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); font-size: 15px; }
.comp-fields label[hidden] { display: none; }
.comp-fields input, .comp-fields select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); width: 100%; min-width: 0; }
.comp-links { display: flex; gap: 4px; justify-content: flex-end; margin-top: -4px; }
.comp-links .link-btn { font-size: 14px; padding: 4px 8px; }
.comp-body { min-height: 220px; max-height: 45vh; overflow: auto; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.topbar #btn-redactar { white-space: nowrap; }

/* ================= Rediseño: lista por bloques + lector ================= */
main { max-width: 920px; }
body.leyendo main { max-width: 1280px; padding-bottom: 120px; }
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Resumen de bloques */
.resumen { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.sum { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 15px; }
.sum:hover { background: var(--surface-2); }
.sum b { font-variant-numeric: tabular-nums; }
.sum .dot, .bloque .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

/* Barra de selección */
.selbar { position: sticky; top: calc(var(--topbar-h, 56px) + 6px); z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 12px; padding: 8px 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.sel-n { margin-right: 4px; }

/* Bloques */
.bloque { margin-bottom: 18px; }
.bloque-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.bloque-tit { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--text); padding: 6px 4px; }
.bloque-n { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 13px; letter-spacing: 0; }
.chev { color: var(--muted); }
.bloque .list { border-left: 4px solid var(--c); }

/* Casillas */
.chk { display: grid; place-items: center; width: 40px; min-height: 40px; cursor: pointer; flex: none; }
.chk input { width: 19px; height: 19px; cursor: pointer; accent-color: var(--primary); }

/* Filas */
.row { padding: 10px 14px 10px 6px; align-items: stretch; gap: 4px; }
.row:hover { background: var(--surface-2); }
.row.sel { background: var(--primary-soft); }
.row > .chk { align-self: center; }
.row-main { padding: 2px 4px; border-radius: 8px; outline-offset: 2px; }
.row .r1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.r-from { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.r-n { color: var(--muted); font-weight: 500; font-size: 13px; }
.r-tags { display: flex; gap: 5px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.row .row-date { margin-left: auto; flex: none; }
.r-subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-snip { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.unread .r-from, .row.unread .r-subj { font-weight: 800; }
.row.unread .row-date { color: var(--text); font-weight: 700; }
.row:not(:has(.chk)) { padding-left: 14px; }
.row-btn { align-self: center; }
.tag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag-draft { background: var(--primary-soft); color: var(--primary); }
.tag-adj { padding: 1px 5px; }
.tag-org[data-org="ASPM"] { background: #e6f0fb; color: #1d5b99; }
.tag-org[data-org="PMS GO"] { background: #efe8fb; color: #5b3a99; }
.tag-org[data-org="Ayto"] { background: #e2f4f7; color: #1b6a7a; }
.tag-org[data-org="Personal"] { background: #fde9f0; color: #9a2f58; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag-org[data-org="ASPM"] { background: #1b2c40; color: #9cc6f2; }
  :root:not([data-theme="light"]) .tag-org[data-org="PMS GO"] { background: #2a2140; color: #c7b1f2; }
  :root:not([data-theme="light"]) .tag-org[data-org="Ayto"] { background: #163238; color: #8fd3e0; }
  :root:not([data-theme="light"]) .tag-org[data-org="Personal"] { background: #3a1d29; color: #f2a9c4; }
}

/* Lector */
.lector-nav { position: sticky; top: var(--topbar-h, 56px); z-index: 6; display: flex; align-items: center; gap: 8px;
  background: var(--bg); padding: 10px 0; margin: -10px 0 8px; }
.lector-nav .pos { color: var(--muted); font-weight: 600; margin-right: auto; margin-left: 4px; }
.btn-sig { background: var(--text); color: var(--bg); border-color: var(--text); font-size: 17px; padding: 10px 22px; }
.btn-sig:hover { background: var(--text); filter: brightness(1.2); }
.lector { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.lector-asunto { font-size: 24px; line-height: 1.25; margin: 4px 0 10px; }
.lector-de { font-size: 17px; }
.lector-de .muted { font-size: 15px; margin-left: 4px; }
.lector-meta { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.lector-cols { display: grid; gap: 20px; margin-top: 16px; }
.lector-correo { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.lector-correo iframe { display: block; width: 100%; height: 300px; border: 0; }
.lector-resp .section-title { margin-top: 0; }
.resp-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (min-width: 1100px) {
  .lector-cols { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); align-items: start; }
  .lector-resp { position: sticky; top: calc(var(--topbar-h, 56px) + 64px); }
}

/* Barra de acciones fija abajo */
.lector-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(20, 24, 31, .08); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.bar-in { max-width: 1280px; margin: 0 auto; display: flex; gap: 8px; align-items: center; }
.bar-in .btn-sig { margin-left: auto; }
.mas { position: relative; }
.menu { position: absolute; bottom: calc(100% + 8px); left: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; z-index: 30; }
.menu button, .menu a { display: block; text-align: left; border: 0; background: none; padding: 11px 12px; border-radius: 8px; cursor: pointer; color: var(--text); text-decoration: none; font-weight: 600; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
@media (max-width: 760px) {
  .lector { padding: 16px 14px; }
  .lector-asunto { font-size: 21px; }
  .lector-bar { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .bar-in { gap: 4px; }
  .bar-in > .btn, .bar-in .mas > .btn { flex-direction: column; gap: 0; min-height: 52px; padding: 4px 8px; font-size: 18px; flex: 1 1 0; }
  .bar-in > .btn span, .bar-in .mas > .btn span { font-size: 11px; font-weight: 600; }
  .bar-in .mas { flex: 1 1 0; display: flex; }
  .bar-in .mas > .btn { width: 100%; }
  .bar-in .btn-sig { flex: 1.4 1 0; font-size: 16px; }
  .menu { left: auto; right: 0; }
  .lector-nav .btn-sm[data-a="anterior"] { display: none; }
  .row .r1 { flex-wrap: wrap; row-gap: 2px; }
  .row .r-tags { order: 3; flex-basis: 100%; flex-wrap: wrap; }
  .row .r-tags:empty { display: none; }
}
body.leyendo .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
@media (max-width: 760px) {
  body.leyendo main { padding-bottom: 170px; }
  body.leyendo .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .bar-in { flex-wrap: wrap; row-gap: 6px; }
  .bar-in .btn-sig, .bar-in > [data-a="enviar"] { order: -1; flex: 1 1 40%; flex-direction: row; gap: 6px; min-height: 48px; font-size: 16px; margin-left: 0; }
  .bar-in > [data-a="enviar"] span { font-size: 16px; }
}
.toast.toast-error { background: #7a1d15; max-width: min(640px, calc(100% - 32px)); user-select: text; }
.toast.toast-error button { color: #ffd2cc; }

/* Etiqueta con desplegable */
.etq { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: 2px 8px 2px 9px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; line-height: 1.5; }
.etq .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.etq-chev { color: var(--muted); font-size: 10px; }
.etq:hover, .etq[aria-expanded="true"] { border-color: var(--c); background: var(--surface); }
.chips .etq { font-size: 13px; padding: 3px 10px; }
.etq-menu { position: fixed; z-index: 70; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 24, 31, .18); padding: 6px; display: grid; }
.etq-menu[hidden] { display: none; }
.etq-tit { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.etq-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text); }
.etq-menu button:hover { background: var(--surface-2); }
.etq-menu button .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.etq-menu button[aria-current] { color: var(--muted); cursor: default; }
.etq-ok { margin-left: auto; color: var(--primary); }

/* Dictado */
.comp-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dictar.on { background: #c5362c; color: #fff; border-color: #c5362c; animation: latido 1.4s ease-in-out infinite; }
@keyframes latido { 50% { box-shadow: 0 0 0 6px rgba(197, 54, 44, .18); } }
.dictando { color: var(--muted); font-style: italic; }
.etq-org { border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.etq-org:hover { border-color: currentColor; }
.etq-sep { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.etq-menu button .tag { font-size: 13px; }
.ver { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 4px; }

/* Acción + etiquetas */
.tag-marca { border: 1px solid transparent; cursor: pointer; font-family: inherit; color: var(--text);
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.tag-marca:hover { border-color: var(--c); }
.tag-marca.auto { background: transparent; border: 1px dashed color-mix(in srgb, var(--c) 70%, transparent); color: var(--muted); }
.chips .tag-marca { font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.resumen-marcas { margin-top: -6px; align-items: center; }
.res-tit { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.sum-marca { font-size: 14px; padding: 4px 11px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.sum-marca.on { background: var(--c); color: #fff; border-color: var(--c); }
.etq-sub { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 6px; }
.etq-menu button .caja { width: 18px; height: 18px; border: 2px solid var(--c); border-radius: 5px; display: grid; place-items: center;
  font-size: 12px; font-weight: 900; color: #fff; flex: none; }
.etq-menu button[aria-checked="true"] .caja { background: var(--c); }
.etq-menu button[role="menuitemradio"][aria-checked="true"] { color: var(--muted); cursor: default; }
.opt .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }

/* Borrador en el hilo: campos editables, estado de guardado y aviso de la pasada */
.resp-tit { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.draft-estado { font-size: 13px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.draft-campos { margin: 6px 0 10px; gap: 6px; }
.draft-campos label { grid-template-columns: 56px 1fr; font-size: 14px; }
.draft-campos input, .draft-campos select { min-height: 40px; }
.aviso-pedido { background: var(--primary-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 8px; }

/* Sugerencias de destinatarios */
.sugerencias { position: fixed; z-index: 1000; max-height: 320px; overflow: auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 4px; max-width: calc(100vw - 16px); }
.sug { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; gap: 1px; padding: 9px 12px;
  border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; font: inherit; min-height: 44px; }
.sug.on, .sug:hover { background: var(--primary-soft); }
.sug-n { font-weight: 600; overflow-wrap: anywhere; }
.sug-e { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.sug mark { background: transparent; color: var(--primary); font-weight: 700; }
.sug-info { padding: 8px 12px; font-size: 13px; color: var(--muted); }
