/* Masternet Soporte — estilos
   Azul Masternet #0A4A80 · tinta #141414 · fondo #F4F6F9 · Poppins */
:root {
  --blue: #0A4A80; --blue-dark: #06335A; --blue-soft: #E0ECF7; --blue-tint: #F0F6FC;
  --ink: #141414; --ink-2: #1F2A37; --muted: #4A5565; --line: #E2E8F0; --line-2: #CBD5E1;
  --bg: #F4F6F9; --card: #FFFFFF;
  --ok: #15803D; --ok-soft: #DCFCE7; --warn: #92400E; --warn-soft: #FEF3C7;
  --wait: #5B21B6; --wait-soft: #EDE9FE; --bad: #991B1B; --bad-soft: #FEE2E2;
  --note: #FFF7E6; --note-line: #D9A441; --note-ink: #3B2A0A;
  --surface: #FFFFFF; --surface-2: var(--surface-2); --surface-3: #E2E8F0; --input: #FFFFFF; --seg-on: #FFFFFF; --nav: #FFFFFF; --side: #FFFFFF;
  --accent-ink: #0A4A80; --on-accent: #FFFFFF;
  --orange-ink: #9A3412; --orange-soft: #FFEDD5; --orange-line: #FED7AA;
  --glow: radial-gradient(120% 90% at 15% 0%, rgba(10,74,128,.13) 0%, rgba(244,246,249,0) 60%), var(--bg);
  --r: 14px; --shadow: 0 1px 2px rgba(10,74,128,.08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: Poppins, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font-size: 15px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
a:hover { color: var(--blue-dark); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #7FB0DE; outline-offset: 2px; }

/* ---------- Botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 0 18px; border-radius: 12px; border: 0; background: var(--blue); color: #fff; font-weight: 600;
  font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 16px; border-radius: 14px; }
.btn.ghost { background: var(--surface); color: var(--accent-ink); border: 1.5px solid var(--blue); }
.btn.ghost:hover { background: var(--blue-tint); }
.btn.soft { background: var(--surface-2); color: var(--accent-ink); font-weight: 500; }
.btn.soft:hover { background: var(--blue-soft); }
.btn.ok { background: var(--surface); color: var(--ok); border: 1.5px solid var(--ok); }
.btn.ok:hover { background: var(--ok-soft); }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.icon-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.wa { background: var(--ok-soft); color: var(--ok); }
.icon-btn.call { background: var(--blue-soft); color: var(--accent-ink); }
svg.i { width: 20px; height: 20px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .textarea, .select { width: 100%; min-height: 52px; border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 0 14px; background: var(--surface); font-size: 16px; }
.textarea { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent-ink); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.error-msg { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-size: 14px; }

.seg { display: flex; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2);
  font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent-ink); font-weight: 600; box-shadow: var(--shadow); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 13px; border: 1.5px solid var(--line-2); border-radius: 20px; background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent-ink); background: var(--blue-soft); color: var(--accent-ink); font-weight: 600; }

.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 10px; white-space: nowrap; background: var(--blue-soft); color: var(--accent-ink); }
.badge.st-progress { background: var(--warn-soft); color: var(--warn); }
.badge.st-wait { background: var(--wait-soft); color: var(--wait); }
.badge.st-closed { background: var(--ok-soft); color: var(--ok); }
.badge.st-overdue { background: var(--bad-soft); color: var(--bad); }
.badge.mod { background: var(--surface-2); color: var(--muted); font-weight: 500; }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: 48px 20px calc(28px + var(--safe-b)); gap: 24px; }
.login .brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 12px; }
.login .brand img { width: 168px; height: auto; }
.login .brand p { margin: 0; color: var(--muted); }
.login .card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; padding: 24px;
  display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.login .foot { margin-top: auto; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; }
.side { display: none; }
.pane-list, .pane-detail { min-width: 0; }
.pane-detail { display: none; }
.view { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; flex: 1; min-width: 0; }

.topbar { background: var(--blue); color: #fff; padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.topbar .row { display: flex; align-items: center; gap: 12px; }
.topbar .row img { width: 36px; height: 36px; border-radius: 8px; background: #fff; }
.topbar .who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar .who small { font-size: 12px; opacity: .85; }
.topbar .who strong { font-size: 18px; font-weight: 600; }
.topbar .icon-btn { color: #fff; background: rgba(255,255,255,.14); }
.topbar .icon-btn:hover { background: rgba(255,255,255,.24); }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 12px; height: 46px;
  padding: 0 14px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }

.tabs { display: flex; gap: 8px; padding: 12px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab[aria-pressed="true"] { background: var(--blue); border-color: var(--accent-ink); color: #fff; font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 10px; padding: 8px 16px calc(110px + var(--safe-b)); }
.tcard { display: flex; flex-direction: column; gap: 7px; background: var(--surface); border-radius: 16px; padding: 14px 16px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow); border: 1.5px solid transparent; }
.tcard:hover { color: inherit; border-color: var(--blue-soft); }
.tcard[aria-current="true"] { border-color: var(--accent-ink); background: var(--blue-tint); }
.tcard .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcard .num { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.tcard .when { margin-left: auto; font-size: 12px; color: var(--muted); }
.tcard .subj { font-size: 15px; font-weight: 600; line-height: 1.35; }
.tcard .meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.tcard .stats { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.tcard .stats > span { display: inline-flex; align-items: center; gap: 4px; }
.tcard .stats svg { width: 15px; height: 15px; }
.tcard .stats b { font-weight: 600; color: var(--ink-2); }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty svg { width: 40px; height: 40px; color: var(--line-2); }
.more { align-self: center; }

.fab { position: fixed; right: 20px; bottom: calc(92px + var(--safe-b)); z-index: 5; height: 56px; padding: 0 20px;
  border-radius: 28px; background: var(--blue); color: #fff; display: flex; align-items: center; gap: 8px;
  font-weight: 600; text-decoration: none; box-shadow: 0 6px 16px rgba(10,74,128,.35); }
.fab:hover { color: #fff; background: var(--blue-dark); }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-b); }
.bottomnav a, .bottomnav button { flex: 1; min-height: 64px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; border: 0; background: none; cursor: pointer; }
.bottomnav [aria-current="page"] { color: var(--accent-ink); font-weight: 600; }
.bottomnav svg { width: 22px; height: 22px; }

/* ---------- Detalle ---------- */
.dhead { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; z-index: 4; }
.dhead .row { display: flex; align-items: center; gap: 8px; }
.dhead h1 { margin: 0 8px; font-size: 19px; font-weight: 600; line-height: 1.3; }
.client { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--blue-soft); color: var(--accent-ink); flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.client .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.client .who span { font-size: 14px; font-weight: 500; }
.client .who small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modbar { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 12px; padding: 6px 6px 6px 12px; margin: 0 8px; flex-wrap: wrap; }
.modbar span { flex: 1; font-size: 13px; }
.modbar strong { color: var(--accent-ink); font-weight: 600; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px; }

.thread { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 24px; }
.msg { max-width: 88%; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
.msg .by { font-size: 12px; font-weight: 600; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.M { align-self: flex-start; background: var(--surface); border-radius: 4px 16px 16px 16px; box-shadow: var(--shadow); }
.msg.M .by { color: var(--accent-ink); }
.msg.R { align-self: flex-end; background: var(--blue); color: #fff; border-radius: 16px 4px 16px 16px; }
.msg.R .by { opacity: .85; }
.msg.R a { color: #fff; }
.msg.N { align-self: stretch; max-width: none; background: var(--note); border: 1px dashed var(--note-line); border-radius: 12px; color: var(--note-ink); font-size: 13px; }
.msg.N .by { color: var(--warn); }
.ev { align-self: center; font-size: 12px; color: var(--muted); text-align: center; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.att { display: block; border-radius: 10px; overflow: hidden; background: var(--surface-3); text-decoration: none; border: 0; padding: 0; cursor: zoom-in; }
.att img { display: block; width: 120px; height: 90px; object-fit: cover; }
.att.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 12px; color: var(--ink-2); cursor: pointer; max-width: 260px; }
.att.file svg { width: 22px; height: 22px; flex: none; color: var(--accent-ink); }
.att.file span { display: flex; flex-direction: column; min-width: 0; }
.att.file b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att.file small { color: var(--muted); }
.msg.R .att.file { background: rgba(255,255,255,.18); color: #fff; }
.msg.R .att.file svg, .msg.R .att.file small { color: #fff; }
.att.audio { background: transparent; overflow: visible; cursor: default; width: 100%; max-width: 300px; }
.att.audio audio { width: 100%; height: 44px; display: block; }

.composer { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 12px calc(12px + var(--safe-b));
  display: flex; flex-direction: column; gap: 10px; z-index: 4; }
.composer .row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea, .composer .rte { flex: 1; min-width: 0; min-height: 44px; max-height: 200px; overflow-y: auto; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 11px 14px; resize: none; font-size: 15px; line-height: 1.45; background: var(--surface); box-sizing: border-box; overflow-wrap: anywhere; }
.composer textarea:focus, .composer .rte:focus { border-color: var(--accent-ink); outline: none; }
.composer.note textarea, .composer.note .rte { background: var(--note); border-color: var(--note-line); }
.composer .rte:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.composer .rte ul, .composer .rte ol, .msg .body.rich ul, .msg .body.rich ol { margin: 4px 0; padding-left: 22px; }
.composer .rte p, .msg .body.rich p { margin: 0 0 6px; }
.msg .body.rich { white-space: normal; }
.msg .body.rich blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--line-2); color: var(--muted); }
/* Barra de formato */
.fmtbar { display: flex; align-items: center; gap: 2px; padding: 0 2px 6px; overflow-x: auto; scrollbar-width: none; }
.fmtbar::-webkit-scrollbar { display: none; }
.fmtbar button { flex: none; width: 38px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 16px; display: grid; place-items: center; cursor: pointer; }
.fmtbar button:hover { background: var(--bg); }
.fmtbar button[aria-pressed="true"] { background: var(--blue-soft); color: var(--accent-ink); }
.fmtbar button svg { width: 19px; height: 19px; }
.fmtbar .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; flex: none; }
.composer .send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.composer .send:disabled { opacity: .5; }
.composer .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.composer .actions .btn { flex: 1; min-height: 44px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 12px; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }

/* ---------- Formularios (ticket rápido) ---------- */
.form { display: flex; flex-direction: column; gap: 18px; padding: 20px 16px calc(28px + var(--safe-b)); max-width: 640px; width: 100%; }
.plainbar { background: var(--surface); padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
.plainbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
.results { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.result { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 58px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; width: 100%; }
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--blue-tint); }
.result[aria-pressed="true"] { background: var(--blue-tint); }
.result .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result .who span { font-size: 14px; font-weight: 500; }
.result .who small { font-size: 12px; color: var(--muted); }
.result.add { color: var(--accent-ink); font-weight: 500; font-size: 14px; }
.selected-client { display: flex; align-items: center; gap: 12px; background: var(--blue-tint); border: 1.5px solid var(--blue); border-radius: 12px; padding: 10px 6px 10px 14px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent-ink); }

/* ---------- Hojas (menús inferiores) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(20,20,20,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; background: var(--surface); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + var(--safe-b));
  display: flex; flex-direction: column; gap: 8px; max-height: 85vh; overflow: auto; }
.sheet h2 { margin: 0 4px 6px; font-size: 16px; font-weight: 600; }
.sheet .opt { min-height: 52px; border: 0; border-radius: 12px; background: var(--bg); text-align: left; padding: 0 16px; font-size: 15px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.sheet .opt:hover { background: var(--blue-soft); }
.sheet .opt[aria-current="true"] { background: var(--blue-soft); color: var(--accent-ink); font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 30; background: #141414; color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--blue-soft); border-top-color: var(--accent-ink); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* ---------- Escritorio ---------- */
@media (min-width: 1024px) {
  .bottomnav, .fab { display: none; }
  .side { display: flex; flex-direction: column; gap: 4px; flex: 0 0 236px; background: var(--blue); color: #fff; padding: 20px 14px;
    position: sticky; top: 0; height: 100vh; }
  .side .logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; font-weight: 600; font-size: 16px; }
  .side .logo img { width: 34px; height: 34px; border-radius: 8px; background: #fff; }
  .side a, .side button.navbtn { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #fff;
    text-decoration: none; font-size: 14px; border: 0; background: none; cursor: pointer; text-align: left; }
  .side a:hover, .side button.navbtn:hover { background: rgba(255,255,255,.1); }
  .side [aria-current="page"] { background: rgba(255,255,255,.16); font-weight: 600; }
  .side .count { margin-left: auto; font-size: 12px; }
  .side .grow { flex: 1; }
  .side .quick { background: var(--surface) !important; color: var(--accent-ink) !important; justify-content: center; font-weight: 600; min-height: 48px; border-radius: 12px; }
  .side .me { font-size: 12px; opacity: .85; padding: 8px 12px 0; }
  .pane-list { flex: 0 1 420px; background: var(--surface); border-right: 1px solid var(--line); height: 100vh; overflow: auto; position: sticky; top: 0; }
  .pane-list .topbar { background: var(--surface); color: var(--ink); padding: 20px 16px 8px; }
  .pane-list .topbar .row { display: none; }
  .pane-list .search { background: var(--bg); }
  .pane-list .tabs { display: none; }
  .pane-list .list { gap: 0; padding: 0 0 24px; }
  .pane-list .tcard { border-radius: 0; box-shadow: none; border: 0; border-top: 1px solid var(--line); }
  .pane-list .tcard[aria-current="true"] { background: var(--blue-tint); box-shadow: inset 4px 0 0 var(--blue); }
  .pane-detail { display: flex; flex: 999 1 520px; flex-direction: column; min-height: 100vh; }
  .pane-detail .view { min-height: 100vh; }
  .pane-detail .dhead .back { display: none; }
  .placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 8px; }
  .thread { max-width: 860px; }
  #toast { bottom: 28px; }
  .composer { padding-bottom: 14px; }
}
@media (max-width: 1023px) {
  .shell.has-detail .pane-list { display: none; }
  .shell.has-detail .pane-detail { display: flex; flex: 1; }
  .shell.has-detail .bottomnav, .shell.has-detail .fab { display: none; }
}

/* ---------- Visor de fotos ---------- */
body.no-scroll { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 40; background: #0B0F14; color: #fff; display: flex; flex-direction: column; }
.v-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.v-btn { width: 48px; height: 48px; border: 0; border-radius: 24px; background: rgba(255,255,255,.12); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.v-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.v-btn svg { width: 22px; height: 22px; }
.v-count { font-size: 14px; font-weight: 600; }
.v-track { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.v-track::-webkit-scrollbar { display: none; }
.v-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.v-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; cursor: zoom-in; }
.v-slide.zoom { overflow: auto; display: block; }
.v-slide.zoom img { max-width: none; max-height: none; width: 250%; cursor: zoom-out; }
.v-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px calc(34px + env(safe-area-inset-bottom, 0px)); font-size: 13px;
  text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.6)); pointer-events: none; }
.v-dots { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.v-dots span { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.4); }
.v-dots span.on { background: #fff; width: 18px; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border: 0; border-radius: 24px;
  background: rgba(255,255,255,.14); color: #fff; display: none; align-items: center; justify-content: center; cursor: pointer; }
.v-nav.prev { left: 16px; } .v-nav.next { right: 16px; }
.v-nav svg { width: 24px; height: 24px; }
@media (hover: hover) and (pointer: fine) { .v-nav { display: inline-flex; } }

/* ---------- Adjuntos y notas de voz ---------- */
.composer .icon-btn.tool { background: var(--surface-2); color: var(--accent-ink); cursor: pointer; }
.composer .send.mic { background: var(--blue); }
.thumb .rm { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 12px; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.chipfile { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 34px 6px 10px; border-radius: 12px;
  background: var(--surface-2); max-width: 240px; }
.chipfile > svg { width: 22px; height: 22px; color: var(--accent-ink); flex: none; }
.chipfile span { display: flex; flex-direction: column; min-width: 0; }
.chipfile b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chipfile small { font-size: 12px; color: var(--muted); }
.chipfile .rm { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 12px; border: 0;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.chipfile .pv { width: 40px; height: 40px; flex: none; border-radius: 20px; border: 0; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chipfile .pv svg { width: 18px; height: 18px; }
.attachbar { display: flex; gap: 8px; flex-wrap: wrap; }
.attachbar .btn { min-height: 44px; cursor: pointer; flex: 1 1 auto; }

.recbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(0,0,0,.12); display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(14px + var(--safe-b)); }
.recbar .rb { width: 52px; height: 52px; flex: none; border: 0; border-radius: 26px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.recbar .rb svg { width: 24px; height: 24px; }
.recbar .cancel { background: var(--bad-soft); color: var(--bad); }
.recbar .done { background: var(--blue); color: #fff; }
.recbar .rinfo { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.recbar .dot { width: 12px; height: 12px; border-radius: 6px; background: #DC2626; animation: blink 1s ease-in-out infinite; }
.recbar .rtime { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recbar .rlbl { font-size: 13px; color: var(--muted); }
.recbar .meter { flex-basis: 100%; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.recbar .meter i { display: block; height: 100%; background: var(--blue); transform-origin: left; transform: scaleX(.08); transition: transform .1s linear; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .recbar .dot { animation: none; } }
@media (min-width: 1024px) { .recbar { left: auto; right: 24px; bottom: 24px; width: 420px; border-radius: 16px; border: 1px solid var(--line); } }

.nomail { margin: 0 8px; font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; }

/* ---------- Validación de clientes ---------- */
.badge.st-validate { background: var(--orange-soft); color: var(--orange-ink); }
.vpanel { margin: 14px 16px 0; background: var(--surface); border: 1.5px solid var(--orange-line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.vpanel h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--orange-ink); }
.vpanel .results { max-height: 260px; overflow: auto; }
.vactions { display: flex; flex-direction: column; gap: 8px; }
.vactions .btn { width: 100%; }
.pick-chosen { display: flex; align-items: center; gap: 10px; background: var(--blue-tint); border: 1.5px solid var(--blue); border-radius: 12px; padding: 8px 6px 8px 14px; }
.pick-chosen span { flex: 1; display: flex; flex-direction: column; }
.pick-chosen b { font-weight: 600; } .pick-chosen small { font-size: 12px; color: var(--muted); }
div.nomail { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mailform { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.mailform .input { flex: 1 1 200px; min-height: 44px; }
.hint.warn, #valHint, #mailHint { color: var(--warn); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
@media (min-width: 1024px) { .vpanel { max-width: 860px; margin: 16px 24px 0; } .vactions { flex-direction: row; } .vactions .btn { width: auto; } }
.subjfield { margin-top: 10px; }
/* Video y PDF dentro del hilo */
.att.video { cursor: default; background: #0F172A; max-width: 100%; display: flex; flex-direction: column; }
.att.video video { display: block; width: 320px; max-width: 100%; max-height: 360px; background: #000; }
.att.video .vlink { font-size: 12px; color: #CBD5E1; padding: 6px 10px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att.file.pdf { padding: 0; cursor: default; }
.att.file.pdf > button { background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.att.file.pdf > a:first-child, .att.file.pdf > button { display: flex; align-items: center; gap: 10px; padding: 10px 4px 10px 12px; color: inherit; text-decoration: none; min-width: 0; }
.att.file.pdf .dl { padding: 10px 12px; font-weight: 600; color: var(--accent-ink); text-decoration: none; flex: none; }
.msg.R .att.file.pdf .dl { color: #fff; }
/* Visor de PDF */
.pdfv .pdf-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; padding: 0 8px; }
.pdf-pages { flex: 1; overflow: auto; padding: calc(72px + env(safe-area-inset-top)) 12px 80px; -webkit-overflow-scrolling: touch; background: #1F2937; }
.pdf-page { margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4); max-width: none; }
.pdfv:not(.zoomed) .pdf-page { max-width: 100%; }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pdf-msg { min-height: 60%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #E5E7EB; text-align: center; padding: 24px; }
.pdf-zoom { position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: #0F172A; border-radius: 999px; padding: 4px; z-index: 3; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.pdf-zoom .v-btn { font-size: 22px; line-height: 1; }
.pdf-pg { min-width: 64px; text-align: center; font-size: 13px; color: #E5E7EB; }
/* Menú de adjuntar */
.sheet .opt svg { width: 22px; height: 22px; color: var(--accent-ink); flex: none; }
.sheet .opt > span { display: flex; flex-direction: column; }
.sheet .opt small { font-size: 12px; color: var(--muted); }
.sheet .opt.cancel { justify-content: center; background: var(--surface); border: 1.5px solid var(--line-2); }
/* Enlaces dentro de los mensajes */
.msg .body a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.msg.R .body a { color: #fff; }
/* Cabecera de la lista: fija arriba en el celular; se esconde al bajar y vuelve al subir */
@media (max-width: 1023px) {
  .lhead { position: sticky; top: 0; z-index: 5; background: var(--bg); transition: transform .22s ease; will-change: transform; }
  .lhead.hide { transform: translateY(-100%); }
  .lhead .tabs { padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .lhead { transition: none; } }
/* Arrastrar archivos sobre la app (PC) */
body.dropping::after { content: 'Suelta aquí para adjuntar'; position: fixed; inset: 12px; z-index: 60; border: 3px dashed var(--blue); border-radius: 18px;
  background: rgba(10,74,128,.08); display: flex; align-items: center; justify-content: center; font: 600 20px Poppins, sans-serif; color: var(--accent-ink); pointer-events: none; }
/* Compartir desde otra app */
.sharebox { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; background: var(--surface); border-radius: 14px; padding: 12px; border: 1px solid var(--line); }
.sharebox img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.sharebox .chipfile { max-width: 100%; }
.sharetext { flex-basis: 100%; margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); font-size: 14px; }
/* Borradores */
.badge.draft { background: var(--orange-soft); color: var(--orange-ink); display: inline-flex; align-items: center; gap: 4px; }
.badge.draft svg { width: 12px; height: 12px; }
.draftline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--orange-ink); padding: 2px 4px 6px; }
.draftline svg { width: 14px; height: 14px; flex: none; }
.draftline span { flex: 1; }
.draftline.quick { margin: 10px 16px 0; background: var(--orange-soft); border: 1px solid var(--orange-line); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.fab.has-draft::after, .side .quick.has-draft::after { content: ''; position: absolute; top: 6px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #F97316; border: 2px solid var(--surface); }
.side .quick { position: relative; }   /* .fab ya es fixed: no se toca su posición */
/* Miniatura: botón de editar */
.thumb .edit { position: absolute; left: 4px; bottom: 4px; width: 30px; height: 30px; border: 0; border-radius: 15px; background: rgba(15,23,42,.75); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb .edit svg { width: 16px; height: 16px; }
/* Editor de fotos */
.editor { position: fixed; inset: 0; z-index: 50; background: #0B0F14; color: #fff; display: flex; flex-direction: column; }
.ed-top { display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; }
.ed-title { font-weight: 600; }
.ed-txt { background: none; border: 0; color: #fff; font: 600 15px Poppins, sans-serif; padding: 10px 14px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.ed-txt.ok { background: var(--blue); }
.ed-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; user-select: none; }
.ed-stage canvas { position: absolute; display: block; }
.ed-over { pointer-events: none; }
.ed-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; }
.ed-crop .h { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.ed-crop .h.nw { left: -15px; top: -15px; cursor: nwse-resize; } .ed-crop .h.ne { right: -15px; top: -15px; cursor: nesw-resize; }
.ed-crop .h.sw { left: -15px; bottom: -15px; cursor: nesw-resize; } .ed-crop .h.se { right: -15px; bottom: -15px; cursor: nwse-resize; }
.editor.marking .ed-crop { pointer-events: none; border-style: dashed; border-color: rgba(255,255,255,.5); }
.editor.marking .ed-crop .h { display: none; }
.editor.marking .ed-stage { cursor: crosshair; }
.ed-load { position: absolute; inset: 0; display: grid; place-items: center; }
.ed-tools { display: flex; gap: 4px; justify-content: center; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); overflow-x: auto; }
.ed-tools button { flex: none; min-width: 60px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: #CBD5E1; font: 500 11px Poppins, sans-serif; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.ed-tools button svg { width: 22px; height: 22px; }
.ed-tools button[aria-pressed="true"] { background: rgba(255,255,255,.12); color: #fff; }
.ed-tools button[data-tool="circle"][aria-pressed="true"], .ed-tools button[data-tool="arrow"][aria-pressed="true"], .ed-tools button[data-tool="pen"][aria-pressed="true"] { color: #FB7185; }
.ed-tools button:disabled { opacity: .35; }
/* Celular/tableta: cámara y adjuntar suben a la barra de formato; la caja de texto queda más ancha */
.fmtbar .tool-m { color: var(--accent-ink); }
@media (max-width: 1023px) { .composer .tool-d { display: none; } }
@media (min-width: 1024px) { .fmtbar .tool-m { display: none; } }
/* Versión de la app */
.side .me .ver { display: block; font-size: 11px; opacity: .75; margin-top: 2px; }
.login .foot.ver { font-size: 11px; color: var(--muted); margin-top: 4px; }
/* Ambiente de pruebas (beta.masternet.mx) */
.beta-ribbon { position: fixed; top: calc(6px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 80; pointer-events: none;
  background: #C2410C; color: #fff; font: 700 11px Poppins, sans-serif; letter-spacing: .8px; padding: 4px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25); opacity: .92; }

/* =====================================================================
   Estilo 2.0 (v1.4) — modo claro y oscuro
   El tema lo pone app.js en <html data-theme="light|dark"> según la preferencia:
   automático por horario, igual que el sistema, siempre claro o siempre oscuro.
   ===================================================================== */
:root[data-theme="dark"] {
  --blue: #2F6FD0; --blue-dark: #2560B8; --blue-soft: rgba(47,111,208,.20); --blue-tint: rgba(47,111,208,.10);
  --ink: #E6EAF0; --ink-2: #CDD5E0; --muted: #9AA4B2; --line: #2A313C; --line-2: #3A4250;
  --bg: #0D1117; --card: #161B22; --surface: #161B22; --surface-2: #1F2630; --surface-3: #232A35;
  --input: #0F141A; --seg-on: #2A3240; --nav: #0F141A; --side: #0F141A;
  --accent-ink: #8DB8F2;
  --ok: #86EFAC; --ok-soft: rgba(34,197,94,.16); --warn: #F5D27A; --warn-soft: rgba(234,179,8,.16);
  --wait: #C4B5FD; --wait-soft: rgba(139,92,246,.20); --bad: #FCA5A5; --bad-soft: rgba(239,68,68,.18);
  --note: rgba(234,179,8,.08); --note-line: rgba(234,179,8,.45); --note-ink: #F5E3B3;
  --orange-ink: #FDBA74; --orange-soft: rgba(249,115,22,.16); --orange-line: rgba(249,115,22,.45);
  --shadow: none;
  --glow: radial-gradient(120% 90% at 15% 0%, rgba(47,111,208,.30) 0%, rgba(13,17,23,0) 60%), var(--bg);
  color-scheme: dark;
}
:root[data-theme="dark"] a:hover { color: #B9D3F6; }
:root[data-theme="dark"] .msg.R .body a, :root[data-theme="dark"] .msg.R a { color: #fff; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
html, body { transition: background-color .2s ease; }

/* Cabecera del celular: fondo con resplandor azul en lugar del bloque azul sólido */
.topbar { background: var(--glow); color: var(--ink); }
.topbar .who small { color: var(--muted); opacity: 1; }
.topbar .icon-btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.topbar .icon-btn:hover { background: var(--surface-2); }
.search { background: var(--input); border: 1px solid var(--line); border-radius: 14px; height: 48px; }
.search:focus-within { border-color: var(--blue); }

/* Colas: botones con contorno; la elegida en azul suave */
.tab { background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); color: var(--accent-ink); }

/* Tarjetas con borde fino en lugar de sombra */
.tcard { box-shadow: none; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.tcard:hover { border-color: var(--line-2); }
.tcard[aria-current="true"] { border-color: var(--blue); background: var(--blue-tint); }
.badge { border-radius: 999px; }
.badge.mod { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.fab { border-radius: 16px; box-shadow: 0 10px 24px rgba(0,0,0,.28); }

/* Ticket */
.dhead { background: var(--glow); }
.modbar { background: var(--surface); border: 1px solid var(--line); }
.facts .badge, .facts > span { border-radius: 10px; }
.msg.M { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.composer { background: var(--nav); }
.seg { background: var(--input); border: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--blue-soft); color: var(--accent-ink); box-shadow: none; }
.composer .icon-btn.tool { background: var(--surface-2); }
.sheet { background: var(--surface); border-top: 1px solid var(--line); }
.sheet .opt { background: var(--surface-2); color: var(--ink); }
.login .card { box-shadow: none; border: 1px solid var(--line); }
.results, .result { background: var(--surface); }
.vpanel, .sharebox { background: var(--surface); }
.empty svg { color: var(--line-2); }

/* Botón de sol/luna */
.themebtn svg { width: 20px; height: 20px; }

/* PC: menú lateral claro/oscuro con secciones, como la propuesta */
@media (min-width: 1024px) {
  .side { background: var(--side); color: var(--ink); border-right: 1px solid var(--line); }
  .side a, .side button.navbtn { color: var(--ink); }
  .side a:hover, .side button.navbtn:hover { background: var(--surface-2); }
  .side [aria-current="page"] { background: var(--blue-soft); color: var(--accent-ink); }
  .side .quick { background: var(--blue) !important; color: #fff !important; }
  .side .me { color: var(--muted); opacity: 1; }
  .side .sect { font-size: 11px; font-weight: 700; letter-spacing: .6px; color: var(--muted); padding: 10px 12px 4px; }
  .side .themeseg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--input); border: 1px solid var(--line);
    border-radius: 12px; padding: 4px; margin: 0 4px 12px; }
  .side .themeseg button { min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center;
    font: 600 11px Poppins, sans-serif; cursor: pointer; padding: 0; }
  .side .themeseg button svg { width: 17px; height: 17px; }
  .side .themeseg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); }
  .pane-list { background: var(--surface); }
  .pane-list .topbar { background: transparent; }
  .pane-list .tcard { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
  .pane-list .tcard[aria-current="true"] { background: var(--blue-tint); box-shadow: inset 4px 0 0 var(--blue); }
}
@media (max-width: 1023px) { .side .themeseg { display: none; } }
.login .card .card { border: 0; background: transparent; }

/* ---- v1.4.1: menú de PC con íconos, tarjetas redondeadas en PC, perfil y "Ver más" ---- */
@media (min-width: 1024px) {
  .side .logo { padding: 0 6px 16px; gap: 10px; }
  .side .logo img { width: 38px; height: 38px; border-radius: 10px; }
  .side .logo span { display: flex; flex-direction: column; min-width: 0; }
  .side .logo b { font-size: 15px; font-weight: 600; }
  .side .logo small { font-size: 11px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .navbtn svg { width: 19px; height: 19px; flex: none; }
  .side .navbtn .lbl { flex: 1; }
  .side .count { color: var(--muted); }
  .side [aria-current="page"] .count { color: inherit; }
  .side .count.pill { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-weight: 600; font-size: 11px; }
  .side .count.pill.validate { background: var(--wait-soft); color: var(--wait); }
  .side .count.pill.overdue { background: var(--bad-soft); color: var(--bad); }
  .pane-list { background: var(--glow); }
  .pane-list .list { gap: 10px; padding: 0 14px 24px; }
  .pane-list .tcard { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .pane-list .tcard:hover { border-color: var(--line-2); }
  .pane-list .tcard[aria-current="true"] { background: var(--blue-tint); border-color: var(--blue); box-shadow: none; }
  .qtitle { display: block; margin: 6px 16px 10px; font-size: 24px; font-weight: 300; letter-spacing: -.2px; }
}
@media (max-width: 1023px) { .qtitle { display: none; } }

/* Perfil (celular) */
.sheet.profile { gap: 14px; padding-top: 10px; }
.sheet.profile .grip { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
.pf-head { display: flex; align-items: center; gap: 12px; }
.pf-av { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--blue-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.pf-av i { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; border: 2px solid var(--surface); }
.pf-who { display: flex; flex-direction: column; min-width: 0; }
.pf-who b { font-size: 16px; font-weight: 600; }
.pf-who small { font-size: 12px; color: var(--muted); }
.pf-sect { font-size: 12px; font-weight: 700; letter-spacing: .6px; color: var(--muted); }
.tm-list { display: flex; flex-direction: column; gap: 8px; }
.tm-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tm-opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.tm-opt > svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.tm-opt span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tm-opt b { font-size: 15px; font-weight: 500; }
.tm-opt small { font-size: 12px; color: var(--muted); }
.tm-opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; background: var(--surface); }
.tm-opt[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-tint); }
.tm-opt[aria-pressed="true"] b { font-weight: 600; }
.tm-opt[aria-pressed="true"] > svg { color: var(--accent-ink); }
.tm-opt[aria-pressed="true"] .radio { border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--surface); background: var(--blue); }
.tm-opt[data-theme-set="claro"] > svg { color: #EAB308; }
.tm-opt[data-theme-set="oscuro"] > svg { color: #A78BFA; }
.pf-note { margin: 0; font-size: 12px; color: var(--muted); }
.pf-out { min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--bad); font: 600 15px Poppins, sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.pf-out svg { width: 19px; height: 19px; }

/* Mensajes largos: 2 renglones y "Ver más" */
.msg .body.clamp.clamp6 { max-height: 9em; }
.msg .body.clamp.clamp2 { max-height: 3em; }
.msg .body.clamp { overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.msg .more-btn { align-self: flex-start; border: 0; background: none; padding: 2px 0; color: var(--accent-ink); font: 600 13px Poppins, sans-serif; cursor: pointer; }
.msg.R .more-btn { color: #fff; }
.msg.N .more-btn { color: var(--warn); }

/* 1.4.2 — correo anterior plegado y fotos en cuadrícula */
.msg .quote-btn { align-self: flex-start; border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 3px 12px; color: var(--muted); font: 600 12px Poppins, sans-serif; cursor: pointer; }
.msg.R .quote-btn { color: #fff; border-color: rgba(255,255,255,.45); }
.msg.N .quote-btn { color: var(--warn); border-color: var(--note-line); }
.msg .quoted { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); border-left: 3px solid var(--line-2); padding-left: 10px; }
.msg .quoted.rich { white-space: normal; }
.msg .quoted[hidden] { display: none; }
.msg.R .quoted { color: rgba(255,255,255,.85); border-left-color: rgba(255,255,255,.45); }
.msg.N .quoted { color: var(--note-ink); }
.pics { display: grid; grid-template-columns: repeat(3, 92px); gap: 6px; }
.pics.one { grid-template-columns: 160px; }
.pics .att.pic { position: relative; width: 100%; aspect-ratio: 1; }
.pics .att.pic img { width: 100%; height: 100%; }
.pics.one .att.pic { aspect-ratio: 4 / 3; }
.pics .plus { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; font: 600 20px Poppins, sans-serif; }
@media (min-width: 1024px) {
  .pics { grid-template-columns: repeat(4, 120px); }
  .pics.one { grid-template-columns: 220px; }
}

/* 1.4.3 — en celular, el último ticket abierto queda marcado al regresar */
@media (max-width: 1023px) {
  .tcard[aria-current="true"] { border-color: var(--blue); background: var(--blue-tint); box-shadow: inset 4px 0 0 var(--blue); }
}
