/* 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: 9px; }
.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: 9px; }
  .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.clampm { max-height: 340px; }
.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); }
}

/* 1.4.5 — señales: nuevo (azul), nuevo asignado (verde agua), nueva respuesta (amarillo), vencido (rojo), por validar (morado) */
:root { --mk-new: #2F6FD0; --mk-asg: #0D9488; --mk-reply: #D97706; }
:root[data-theme="dark"] { --mk-new: #4C8EF0; --mk-asg: #2DD4BF; --mk-reply: #FBBF24; }
.dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--mk-new); }
.dot.assigned { background: var(--mk-asg); }
.dot.reply { background: var(--mk-reply); }
.dot.overdue { background: var(--bad); }
.dot.validate { background: var(--wait); }
.tcard .dot { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.badge.mk { font-weight: 600; }
.badge.mk.new { background: color-mix(in srgb, var(--mk-new) 16%, transparent); color: var(--mk-new); }
.badge.mk.assigned { background: color-mix(in srgb, var(--mk-asg) 16%, transparent); color: var(--mk-asg); }
.badge.mk.reply { background: color-mix(in srgb, var(--mk-reply) 18%, transparent); color: var(--mk-reply); }
.badge.st-validate { background: var(--wait-soft); color: var(--wait); }
.tcard:has(.dot.new) { border-color: color-mix(in srgb, var(--mk-new) 60%, var(--line)); }
.tcard:has(.dot.assigned) { border-color: color-mix(in srgb, var(--mk-asg) 60%, var(--line)); }
.tcard:has(.dot.reply) { border-color: color-mix(in srgb, var(--mk-reply) 60%, var(--line)); }
/* Pastillas de conteo (menú lateral y pestañas) */
.pill.mk-new { background: var(--mk-new); color: #fff; }
.pill.mk-assigned { background: var(--mk-asg); color: #fff; }
.pill.mk-reply { background: var(--mk-reply); color: #1F1300; }
:root[data-theme="dark"] .pill.mk-assigned { color: #04201D; }
.side .counts { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }
.side .counts .count { margin-left: 0; }
.side .count.pill.mk-new, .side .count.pill.mk-assigned, .side .count.pill.mk-reply { font-weight: 700; }
.tab { display: inline-flex; align-items: center; gap: 6px; }
.tab .tc { font-size: 13px; opacity: .85; }
.tab .tc.pill { opacity: 1; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; }
.tab .tc.pill.validate { background: var(--wait-soft); color: var(--wait); }
.tab .tc.pill.overdue { background: var(--bad-soft); color: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin: 4px 0 90px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 8px; height: 8px; }
@media (min-width: 1024px) { .legend { margin-bottom: 16px; } }

/* 1.4.6 — nota o respuesta de compañero: naranja; la respuesta del cliente queda amarilla */
:root { --mk-reply: #CA8A04; --mk-note: #EA580C; }
:root[data-theme="dark"] { --mk-reply: #FACC15; --mk-note: #FB923C; }
.dot.note { background: var(--mk-note); }
.badge.mk.note { background: color-mix(in srgb, var(--mk-note) 16%, transparent); color: var(--mk-note); }
.tcard:has(.dot.note) { border-color: color-mix(in srgb, var(--mk-note) 60%, var(--line)); }
.pill.mk-note { background: var(--mk-note); color: #fff; }
:root[data-theme="dark"] .pill.mk-note { color: #2A1003; }


/* 1.4.9 — tarjeta: persona · empresa y, abajo, tema de ayuda */
.tcard .meta.topic { font-size: 12.5px; opacity: .8; margin-top: -2px; }
.tcard .meta.topic svg { width: 13px; height: 13px; vertical-align: -2px; }

/* 1.5.0 — imágenes dentro del correo */
.msg .body .att.inl { display: block; margin: 6px 0; padding: 0; border: 0; background: transparent; border-radius: 10px; overflow: hidden; max-width: 100%; cursor: zoom-in; }
.msg .body .att.inl img { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; border-radius: 10px; }

/* 1.5.0 — hojas de opciones con íconos (mismo estilo que el panel de Perfil) */
.sheet.nice { gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.sheet.nice .grip { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin-bottom: 4px; }
.sheet.nice h2 { margin: 2px 4px 6px; font-size: 16px; font-weight: 600; }
.sheet.nice .opt { min-height: 58px; gap: 12px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.sheet.nice .opt:hover { background: var(--blue-tint); border-color: var(--line-2); }
.sheet.nice .opt > svg { width: 22px; height: 22px; color: var(--accent-ink); flex: none; }
.sheet.nice .opt > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sheet.nice .opt b { font-size: 15px; font-weight: 500; }
.sheet.nice .opt small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet.nice .opt .go { width: 18px; height: 18px; color: var(--muted); }
.sheet.nice .opt .sdot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin: 0 5px; }
.sheet.nice .opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.sheet.nice .opt[aria-current="true"] { border-color: var(--blue); background: var(--blue-tint); color: var(--ink); }
.sheet.nice .opt[aria-current="true"] b { font-weight: 600; }
.sheet.nice .opt[aria-current="true"] .radio { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 4px var(--surface); }
.sheet.nice .opt.primary { border-color: color-mix(in srgb, var(--ok, #16A34A) 55%, var(--line)); }
.sheet.nice .opt.primary > svg { color: var(--ok, #16A34A); }
.sheet.nice .opt.danger { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.sheet.nice .opt.danger > svg, .sheet.nice .opt.danger b { color: var(--bad); }
.sheet.nice .opt.cancel { justify-content: center; min-height: 50px; margin-top: 4px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-weight: 500; }
@media (min-width: 1024px) {
  .sheet-wrap { align-items: center; }
  .sheet.nice { max-width: 440px; border-radius: 20px; border: 1px solid var(--line); padding-bottom: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
  .sheet.nice .grip { display: none; }
}

/* 1.5.1 — botones de actualizar */
@keyframes mnspin { to { transform: rotate(360deg); } }
.spin svg { animation: mnspin .8s linear infinite; }
.side .sect { display: flex; align-items: center; justify-content: space-between; }
.side .sref { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; margin-right: -6px; }
.side .sref:hover { background: var(--blue-tint); color: var(--accent-ink); }
.side .sref svg { width: 17px; height: 17px; }

/* 1.6.0 — estado (gris con ícono), prioridad y condiciones */
.tg { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font: 600 12px Poppins, sans-serif; white-space: nowrap; border: 1px solid transparent; }
.tg svg { width: 12px; height: 12px; flex: none; }
.tg.st { border-color: var(--line-2); color: var(--ink-2); background: transparent; }
.tg.mod { border-color: var(--line); color: var(--muted); font-weight: 500; background: transparent; }
.tg.pr-emergency { background: var(--bad-soft); color: var(--bad); }
.tg.pr-high { background: color-mix(in srgb, #F59E0B 16%, transparent); color: #B45309; }
:root[data-theme="dark"] .tg.pr-high { color: #FBBF24; }
.tg.pr-normal { background: var(--ok-soft); color: var(--ok); }
.tg.pr-low { border: 1px dashed var(--line-2); color: var(--muted); background: transparent; }
.tg.ovd { background: var(--bad-soft); color: var(--bad); }
.tg.val { background: var(--wait-soft); color: var(--wait); }
.tcard .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.dhead .row .tg.st { margin-left: 2px; }
.facts { align-items: center; }
.legend { margin: 6px 0 90px; }
.legend .linkbtn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legend .linkbtn svg { width: 15px; height: 15px; }
@media (min-width: 1024px) { .legend { margin-bottom: 16px; } }
.side .sect .sref + .sref { margin-left: 2px; }
.side .sect span { flex: 1; }
/* Opciones de prioridad con su color */
.sheet.nice .opt.pr-emergency > svg { color: var(--bad); }
.sheet.nice .opt.pr-high > svg { color: #F59E0B; }
.sheet.nice .opt.pr-normal > svg { color: var(--ok); }
.sheet.nice .opt.pr-low > svg { color: var(--muted); }
.sheet.nice .opt > svg.i { width: 20px; height: 20px; }
/* Leyenda */
.legendbox { max-height: 92vh; overflow-y: auto; }
.legendbox .lg-rule { margin: 0 2px 4px; font-size: 13px; color: var(--ink-2); background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.legendbox h3 { margin: 10px 4px 2px; font-size: 12px; letter-spacing: .6px; color: var(--muted); }
.legendbox h3 small { letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.legendbox .lg-it { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 4px; font-size: 14px; }
.legendbox .lg-it .dot { margin: 0 4px; }
.legendbox .lg-it b { font-weight: 500; }
.legendbox .lg-it b:empty { display: none; }
.legendbox .lg-it small { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); }
.sheet.profile .tm-opt[data-pf="legend"] > svg:last-child { width: 18px; height: 18px; }

/* 1.6.2 — nombres de cola en un solo renglón aunque haya varias pastillas */
.side .navbtn .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.side .navbtn .counts { flex: none; }
.side .navbtn .count.pill { min-width: 20px; height: 20px; padding: 0 6px; }

/* 1.6.3 — cola actual resaltada en el menú lateral (PC) */
@media (min-width: 1024px) {
  .side .navbtn[aria-current="page"] { background: var(--blue-tint); color: var(--ink); box-shadow: inset 3px 0 0 var(--blue); font-weight: 600; }
  :root[data-theme="dark"] .side .navbtn[aria-current="page"] { background: rgba(76,142,240,.16); }
  .side .navbtn[aria-current="page"] > svg { color: var(--accent-ink); }
}
/* Deslizar entre colas (celular) */
@keyframes mnSlideL { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mnSlideR { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mnBump { 0%, 100% { transform: none; } 30% { transform: translateX(10px); } 60% { transform: translateX(-6px); } }
.listview .list.slide-l { animation: mnSlideL .22s ease-out; }
.listview .list.slide-r { animation: mnSlideR .22s ease-out; }
.listview .list.bump { animation: mnBump .3s ease-out; }
@media (prefers-reduced-motion: reduce) { .listview .list.slide-l, .listview .list.slide-r, .listview .list.bump { animation: none; } }
/* 1.6.4 — al deslizar, la pantalla no se mueve de lado (barra de abajo, botón y letrero quedan fijos) */
@media (max-width: 1023px) {
  /* clip (no hidden): hidden convierte al body en contenedor de scroll y rompe las cabeceras fijas */
  html, body { overflow-x: clip; overscroll-behavior-x: none; }
  .pane-list, .listview { overflow-x: clip; }
  .listview .list { touch-action: pan-y; }
}

/* 1.6.6 — videos incrustados (YouTube / Vimeo) */
.msg .body .vcard { display: flex; flex-direction: column; max-width: 340px; margin: 6px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2, var(--surface)); color: var(--ink); text-decoration: none; }
.msg .body .vcard .vthumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0F172A; }
.msg .body .vcard .vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg .body .vcard .vthumb i { position: absolute; inset: 0; display: grid; place-items: center; }
.msg .body .vcard .vthumb i svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; background: rgba(220,38,38,.92); color: #fff; }
.msg .body .vcard .vtxt { display: flex; flex-direction: column; padding: 8px 12px; }
.msg .body .vcard .vtxt b { font-size: 13px; }
.msg .body .vcard .vtxt small { font-size: 12px; color: var(--muted); }
.msg.R .body .vcard { color: var(--ink); }

/* 1.6.8 — contacto escondido tras una pestañita (celular y tableta) */
.client .ctc { display: flex; gap: 8px; flex: none; }
.client .ctc-tab { display: none; }
.client .icon-btn.mailto { color: var(--accent-ink); background: var(--blue-soft); }
@media (max-width: 1023px) {
  .client { position: relative; overflow: hidden; }
  .client .who small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .client .ctc { position: absolute; right: 52px; top: 50%; transform: translate(calc(100% + 40px), -50%); opacity: 0; pointer-events: none;
    padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.25);
    transition: transform .22s ease, opacity .18s ease; z-index: 2; }
  .client.ctc-open .ctc { transform: translate(0, -50%); opacity: 1; pointer-events: auto; }
  .client .ctc-tab { display: inline-flex; align-items: center; justify-content: center; gap: 2px; flex: none; width: 40px; height: 48px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2, var(--surface)); color: var(--accent-ink); cursor: pointer; padding: 0; }
  .client .ctc-tab svg { width: 14px; height: 14px; }
  .client .ctc-tab .chev { width: 12px; height: 12px; transform: rotate(180deg); transition: transform .2s; color: var(--muted); }
  .client.ctc-open .ctc-tab .chev { transform: none; }
  .client.ctc-open .ctc-tab { background: var(--blue-tint); }
}

/* 1.6.9 — caja de texto estilo WhatsApp (clip y cámara dentro) y composer compacto en celular/tableta */
.composer .rte-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.composer .rte-wrap .rte { flex: 1; min-width: 0; }
.composer .intools { display: none; }
.fmtbar .tool-m { display: none !important; }
@media (max-width: 1023px) {
  .composer .intools { display: flex; position: absolute; right: 4px; bottom: 4px; gap: 0; }
  .composer .intools .tool-in { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
  .composer .intools .tool-in:active { background: var(--bg); }
  .composer .intools .tool-in svg { width: 21px; height: 21px; }
  .composer .rte-wrap .rte { padding-right: 82px; }
  /* Responder/Nota y el formato solo aparecen mientras escribes */
  .composer:not(.active) .seg, .composer:not(.active) .fmtbar { display: none; }
  .composer.active .seg { animation: mnFadeIn .15s ease-out; }
}
@keyframes mnFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 1.7.0 — tarjeta de YouTube tipo vista previa */
.vcard.yt { display: flex; flex-direction: column; width: 100%; max-width: 360px; margin: 6px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.msg.R .vcard.yt { background: var(--surface); }
.vcard.yt .vthumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0F172A; }
.vcard.yt .vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard.yt .ytplay { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent 60%, rgba(0,0,0,.25)); }
.vcard.yt .ytplay .ytlogo { width: 56px; height: 40px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.vcard.yt .vtxt { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px 10px; }
.vcard.yt .vtxt b { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); }
.vcard.yt .vtxt small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.vcard.yt .vtxt small .ytlogo { width: 16px; height: 12px; flex: none; }
.vcard.yt:hover .vtxt b { text-decoration: underline; }
.msg .vcards { display: flex; flex-direction: column; gap: 6px; }
.msg .body .vcard.yt .vthumb i svg.ytlogo { width: 56px; height: 40px; padding: 0; border-radius: 0; background: none; }
.msg .body .vcard.yt { max-width: 360px; }

/* 1.7.1 — tarjeta de YouTube compacta (miniatura chica a la izquierda, título y canal a la derecha) */
.vcard.yt, .msg .body .vcard.yt { flex-direction: row; align-items: center; gap: 10px; max-width: 420px; padding: 6px; border-radius: 12px; }
.vcard.yt .vthumb { flex: none; width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }
.vcard.yt .ytplay { background: rgba(0,0,0,.12); }
.vcard.yt .ytplay .ytlogo, .msg .body .vcard.yt .vthumb i svg.ytlogo { width: 26px; height: 19px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
.vcard.yt .vtxt { flex: 1; min-width: 0; padding: 0 4px 0 0; gap: 2px; }
.vcard.yt .vtxt b { font-size: 13px; }
.vcard.yt .vtxt small { font-size: 11.5px; }
.vcard.yt .vtxt small .ytlogo { display: none; }

/* 1.7.2 — Publicar / Nota junto a la barra de formato (en lugar de los dos botones grandes) */
.fmtbar .grow { flex: 1; min-width: 6px; }
.fmtbar .modesw { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.fmtbar .modesw button { width: auto; height: 32px; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; border-radius: 9px; font: 600 13px Poppins, sans-serif; color: var(--muted); background: transparent; }
.fmtbar .modesw button svg { width: 16px; height: 16px; }
.fmtbar .modesw button:disabled { opacity: .45; cursor: not-allowed; }
.fmtbar .modesw .m-reply[aria-pressed="true"] { background: var(--blue); color: #fff; }
.fmtbar .modesw .m-note[aria-pressed="true"] { background: #EAB308; color: #2A1E00; }
@media (max-width: 1023px) {
  .fmtbar button { width: 34px; }
  .fmtbar .modesw { padding: 0; border: 0; background: transparent; }
  .fmtbar .modesw button[aria-pressed="false"] { display: none; }        /* un solo botón que alterna */
  .fmtbar .modesw button { padding: 0 10px; }
  .fmtbar .modesw button::after { content: '⇄'; font-size: 12px; opacity: .7; margin-left: 2px; }
}

/* 1.7.3 — panel lateral del ticket (PC con pantalla ancha) */
.slimhead { display: none; }
@media (min-width: 1280px) {
  .pane-detail .view.withaside { padding-right: 340px; }
  .withaside .dhead .client, .withaside .dhead .modbar, .withaside .dhead .facts { display: none; }
  .withaside .slimhead { display: block; margin: 2px 8px 6px; font-size: 13px; color: var(--muted); }
  .aside { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; overflow-y: auto; padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 12px;
    border-left: 1px solid var(--line); background: var(--bg); z-index: 5; scrollbar-width: thin; }
  .as-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
  .as-card h4 { margin: 0 0 2px; font-size: 11px; letter-spacing: .7px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .as-card h4 small { font-size: 11px; letter-spacing: 0; padding: 0 7px; border-radius: 999px; background: var(--bg); }
  .as-cli { display: flex; gap: 10px; align-items: center; }
  .as-cli .avatar { width: 42px; height: 42px; flex: none; }
  .as-cli b { display: block; font-size: 15px; font-weight: 600; }
  .as-cli small { color: var(--muted); font-size: 12px; }
  .as-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 13px; margin-top: 4px; }
  .as-kv > span:nth-child(odd) { color: var(--muted); }
  .as-kv > span:nth-child(even) { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .as-kv i { color: var(--muted); font-style: normal; }
  .as-acts { display: flex; gap: 8px; margin-top: 6px; }
  .as-acts .icon-btn { flex: 1; height: 40px; border-radius: 12px; }
  .as-acts .icon-btn.mailto { background: var(--blue-soft); color: var(--accent-ink); }
  .as-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; font-size: 13px; }
  .as-row > span:first-child { color: var(--muted); flex: none; }
  .as-row .as-val { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .as-sel { display: inline-flex; align-items: center; gap: 4px; max-width: 200px; border: 0; background: transparent; padding: 2px 0 2px 6px; border-radius: 999px; cursor: pointer; font: 600 13px Poppins, sans-serif; color: var(--ink); }
  .as-sel:hover { background: var(--blue-tint); }
  .as-sel .chev { width: 14px; height: 14px; color: var(--muted); transform: rotate(90deg); flex: none; }
  .as-bad { color: var(--bad); font-weight: 600; }
  .as-warn { color: #D97706; font-weight: 600; }
  :root[data-theme="dark"] .as-warn { color: #FBBF24; }
  .as-gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .as-gal button { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--surface-3); cursor: zoom-in; }
  .as-gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .as-gal .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; font-weight: 700; z-index: 1; }
  .as-file { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 4px; border: 0; background: transparent; border-radius: 8px; color: var(--ink); text-decoration: none; font: 500 12.5px Poppins, sans-serif; cursor: pointer; text-align: left; }
  .as-file:hover, .as-link:hover, .as-tk:hover { background: var(--blue-tint); }
  .as-file svg { width: 17px; height: 17px; color: var(--accent-ink); flex: none; }
  .as-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .as-file small { color: var(--muted); flex: none; }
  .as-link { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 4px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 12.5px; }
  .as-link svg { width: 18px; height: 14px; flex: none; color: var(--accent-ink); }
  .as-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .as-tk { display: flex; flex-direction: column; gap: 2px; padding: 7px 4px; border-top: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 12.5px; }
  .as-tk:first-of-type { border-top: 0; }
  .as-tk b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .as-tk .n { color: var(--accent-ink); margin-right: 6px; }
  .as-tk small { color: var(--muted); display: flex; align-items: center; gap: 4px; }
  .as-tk small svg { width: 11px; height: 11px; }
}

/* 1.7.5 — ordenar tickets */
.qrow { display: flex; align-items: center; gap: 10px; margin: 2px 16px 10px; }
.qrow .qtitle { margin: 0; flex: 1; min-width: 0; }
.qrow .qcount { font-size: 12.5px; color: var(--muted); flex: 1; }
.sortbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; flex: none; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 600 12.5px Poppins, sans-serif; cursor: pointer; white-space: nowrap; }
.sortbtn svg { width: 16px; height: 16px; color: var(--accent-ink); }
.sortbtn.custom { background: var(--blue); border-color: var(--blue); color: #fff; }
.sortbtn.custom svg { color: #fff; }
.sortbtn[hidden] { display: none; }
@media (min-width: 1024px) {
  .qrow { margin: 6px 16px 10px; }
  .qrow .qcount { flex: none; order: 2; }
  .qrow .qtitle { order: 1; }
  .qrow .sortbtn { order: 3; }
}
@media (max-width: 1023px) {
  .qrow .qtitle { display: none; }
  .qrow { margin: 0 16px 8px; }
}
@media (min-width: 1024px) { .qrow .qtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media (min-width: 1024px) and (max-width: 1500px) { .qrow .qcount { display: none; } }

/* 1.8.0 — Inicio (PC) */
.side .logo { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.side .homebtn { margin-bottom: 4px; }
.homep { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 1040px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.homep h1 { margin: 0; font-size: 28px; font-weight: 300; letter-spacing: -.3px; }
.homep .sub { margin: -10px 0 0; color: var(--muted); font-size: 14px; }
.homep .sub b { color: var(--ink); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { --kc: var(--accent-ink); text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: var(--kc); transform: translateY(-1px); }
.kpi[aria-pressed="true"] { border-color: var(--kc); box-shadow: inset 0 0 0 1px var(--kc); background: color-mix(in srgb, var(--kc) 8%, var(--surface)); }
.kpi .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 4px; background: color-mix(in srgb, var(--kc) 16%, transparent); color: var(--kc); }
.kpi .ic svg { width: 17px; height: 17px; }
.kpi b { font-size: 30px; font-weight: 600; line-height: 1.1; }
.kpi > span:not(.ic) { font-size: 13px; color: var(--ink-2); }
.kpi small { font-size: 11.5px; color: var(--muted); }
.kpi.k-avisos { --kc: var(--mk-new); } .kpi.k-hoy { --kc: #D97706; } .kpi.k-urgentes { --kc: var(--bad); } .kpi.k-espera { --kc: var(--wait); }
:root[data-theme="dark"] .kpi.k-hoy { --kc: #FBBF24; }
.hgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.hbox { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; }
.hbox h3 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .7px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hbox h3 small, .hbox h3 .linkbtn { letter-spacing: 0; font-size: 12px; }
.hbox .ai { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink); text-decoration: none; border-radius: 8px; }
.hbox .ai:first-of-type { border-top: 0; }
.hbox .ai:hover { background: var(--blue-tint); }
.hbox .ai .d { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.hbox .ai .n { color: var(--accent-ink); font-weight: 600; flex: none; }
.hbox .ai .s { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbox .ai .s small { color: var(--muted); font-size: 12.5px; }
.hbox .ai .w { color: var(--muted); font-size: 12px; flex: none; }
.hbox .ai .tg2 { font: 600 11px Poppins, sans-serif; padding: 2px 8px; border-radius: 999px; flex: none; background: var(--bg); color: var(--ink-2); }
.ai .d.reply, .ai .tg2.reply { --c: var(--mk-reply); } .ai .d.assigned, .ai .tg2.assigned { --c: var(--mk-asg); }
.ai .d.note, .ai .tg2.note { --c: var(--mk-note); } .ai .d.new, .ai .tg2.new { --c: var(--mk-new); }
.ai .d.urg, .ai .tg2.urg { --c: var(--bad); } .ai .d.due, .ai .tg2.due { --c: #D97706; } .ai .d.high, .ai .tg2.high { --c: #D97706; }
:root[data-theme="dark"] .ai .d.due, :root[data-theme="dark"] .ai .tg2.due, :root[data-theme="dark"] .ai .d.high, :root[data-theme="dark"] .ai .tg2.high { --c: #FBBF24; }
.hbox .ai .d[class*=" "] { background: var(--c); }
.hbox .ai .tg2:not(.st) { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.hempty { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; margin: 8px 4px; }
.hempty svg { width: 18px; height: 18px; color: var(--ok); }
.qa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa a, .qa button { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; font: 500 13.5px Poppins, sans-serif; background: var(--bg); cursor: pointer; text-align: left; }
.qa a:hover, .qa button:hover { border-color: var(--line-2); }
.qa svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; }
.qa .pri { background: var(--blue); border-color: var(--blue); color: #fff; }
.qa .pri svg { color: #fff; }
@media (max-width: 1350px) { .hgrid { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .side .homebtn { display: none; } }
.topbar .logobtn { border: 0; padding: 0; background: transparent; cursor: pointer; flex: none; display: grid; }
.qa { grid-template-columns: 1fr; }
.qa a, .qa button { white-space: nowrap; padding: 11px 12px; }
@media (max-width: 1350px) { .qa { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 1.8.1 — vista previa de video y grabadora con calidad */
.chipfile.vid .pv { background: var(--blue); }
.vplay, .vrec { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; color: #fff; }
.vplay .vp-top, .vrec .vr-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgba(0,0,0,.6), transparent); font: 600 13px Poppins, sans-serif; }
.vplay video { flex: 1; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vplay .v-btn, .vrec .v-btn { width: 42px; height: 42px; border-radius: 21px; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vplay .v-btn svg, .vrec .v-btn svg { width: 22px; height: 22px; }
.vrec video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.vrec .vr-play { object-fit: contain; }
.vrec .vr-stat { padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.45); }
.vrec.recording .vr-stat { background: rgba(220,38,38,.85); }
.vrec .vr-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 14px 16px calc(22px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.vrec .vr-q { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.45); }
.vrec .vr-q button { border: 0; border-radius: 10px; background: transparent; color: #fff; padding: 6px 12px; display: flex; flex-direction: column; align-items: center; cursor: pointer; font: inherit; }
.vrec .vr-q button b { font: 600 13px Poppins, sans-serif; }
.vrec .vr-q button small { font-size: 10.5px; opacity: .8; }
.vrec .vr-q button[aria-pressed="true"] { background: #fff; color: #111; }
.vrec.recording .vr-q { opacity: .35; pointer-events: none; }
.vrec .vr-ctl { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; }
.vrec .vr-shot { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.vrec .vr-shot i { width: 58px; height: 58px; border-radius: 50%; background: #EF4444; transition: all .15s; }
.vrec.recording .vr-shot i { width: 28px; height: 28px; border-radius: 6px; }
.vrec .vr-done { display: flex; gap: 10px; width: 100%; max-width: 420px; }
.vrec .vr-done .btn { flex: 1; }
.vrec [hidden] { display: none !important; }

/* 1.8.2 — barra de envío */
#upbar { position: fixed; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b, 0px)); z-index: 70; max-width: 520px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 14px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#upbar .ub-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
#upbar .ub-txt { font: 600 13px Poppins, sans-serif; color: var(--ink); }
#upbar .ub-x { border: 0; background: transparent; color: var(--bad); font: 600 13px Poppins, sans-serif; cursor: pointer; padding: 4px 6px; }
#upbar .ub-x[hidden] { display: none; }
#upbar .ub-track { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
#upbar .ub-track i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 3px; transition: width .2s; }
#upbar.proc .ub-track i { background: linear-gradient(90deg, var(--blue) 0%, #7FB0F5 50%, var(--blue) 100%); background-size: 200% 100%; animation: ubShimmer 1.1s linear infinite; }
@keyframes ubShimmer { to { background-position: -200% 0; } }
body.uploading #composer, body.uploading #qf { pointer-events: none; }
body.uploading #composer > *, body.uploading #qf > * { opacity: .5; }
#upbar .ub-txt { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
#upbar .ub-txt small { font-weight: 500; color: var(--muted); font-size: 12px; }

/* 1.8.3 — reproducir video/audio desde el panel lateral */
.vplay .vp-name { flex: 1; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vplay a.v-btn { text-decoration: none; }
.vplay.aud { background: rgba(0,0,0,.75); align-items: center; justify-content: center; }
.vplay .vp-aud { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(440px, 90vw); padding: 28px 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.vplay .vp-aud > svg { width: 44px; height: 44px; padding: 14px; border-radius: 50%; background: var(--blue-soft); color: var(--accent-ink); box-sizing: content-box; }
.vplay .vp-aud audio { width: 100%; }

/* 1.8.4 — filtro por agente */
.agentbtn .lab { font-weight: 500; opacity: .8; }
.agentbtn[hidden] { display: none; }
@media (max-width: 1023px) {
  .qrow .sortbtn { padding: 0 10px; }
  .qrow .agentbtn .lab { display: none; }
  .qrow.hasagent .qcount { display: none; }
  .qrow.hasagent { justify-content: flex-end; }
  .qrow .sortbtn span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}

/* 1.8.5 — en PC el nombre de la cola ya se ve en el menú lateral: el renglón queda para el conteo y los filtros */
@media (min-width: 1024px) {
  .qrow .qtitle { display: none; }
  .qrow .qcount { display: block !important; flex: 1; order: 0; font-size: 13px; }
  .qrow { margin: 4px 16px 10px; }
}
.qrow .qcount { white-space: nowrap; }
.qrow .agentbtn .lab { display: none; }
.qrow .sortbtn { min-width: 0; }
.qrow .sortbtn span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1024px) { .qrow { gap: 8px; } }

/* 1.8.7 — notas editadas y tickets reabiertos */
.msg .by .edited { font-weight: 500; opacity: .75; font-style: italic; }
.msg .by .ebtn { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 4px; vertical-align: -6px; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; opacity: .6; }
.msg .by .ebtn:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.msg .by .ebtn svg { width: 14px; height: 14px; }
.msg.editing { outline: 2px solid var(--note-line); }
.msg .editbox { min-height: 70px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--note-line); background: var(--surface); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; outline: none; }
.msg .editacts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.msg .editacts small { flex: 1; min-width: 160px; font-size: 11.5px; opacity: .75; }
.tg.reop { background: var(--orange-soft); color: var(--orange-ink); }

/* 1.9.0 — selector con 3 temas, botón Ticket rápido compacto y "subir" */
.side .themeseg { grid-template-columns: 1fr 1fr 1.4fr 1fr !important; }
.side .themeseg button[data-theme-set="intermedio"] { order: 2; } .side .themeseg button[data-theme-set="hora"] { order: 3; } .side .themeseg button[data-theme-set="oscuro"] { order: 4; }
.tm-row.tm-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tm-row.tm-3 .tm-opt { padding: 0 10px; gap: 8px; }
.tm-row.tm-3 .tm-opt b { font-size: 13.5px; }
.tm-opt[data-theme-set="intermedio"] > svg { color: #3B6FB6; }
.fab { width: 58px; height: 58px; padding: 0; border-radius: 50%; justify-content: center; right: 18px; }
.fab svg { width: 26px; height: 26px; }
.totop { position: fixed; right: 26px; bottom: calc(160px + var(--safe-b)); z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 70%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.18); animation: mnFadeIn .2s ease-out; }
.totop[hidden] { display: none; }
.totop svg { width: 20px; height: 20px; }
@media (min-width: 1024px) { .totop { display: none !important; } }

/* ===== Tema INTERMEDIO: azul marino en menú y cabeceras, fondo gris azulado, tarjetas blancas ===== */
:root[data-theme="mid"] {
  --bg: #E6EBF2; --surface: #FBFCFE; --surface-2: #F1F4F9; --surface-3: #DCE3EC; --card: #FFFFFF; --input: #FFFFFF;
  --line: #D3DBE6; --line-2: #BBC6D4; --ink: #16202C; --ink-2: #253243; --muted: #58667A;
  --blue: #0E4F8A; --blue-dark: #0A3D6B; --blue-soft: #DCE8F5; --blue-tint: #EDF3FA; --accent-ink: #0E4F8A;
  --glow: linear-gradient(180deg, #DDE4EE 0%, #E6EBF2 220px);
  --navy: #0F2136; --navy-2: #163053;
  background: var(--bg);
}
:root[data-theme="mid"] body { background: var(--bg); }
/* Zonas azul marino: menú lateral, cabecera del ticket, barra de arriba y de abajo del celular.
   Dentro de ellas se usan los colores del modo oscuro para que todo se lea bien. */
:root[data-theme="mid"] .side, :root[data-theme="mid"] .pane-detail .dhead, :root[data-theme="mid"] .topbar, :root[data-theme="mid"] .bottomnav {
  --blue: #4C8EF0; --blue-dark: #2560B8; --blue-soft: rgba(76,142,240,.20); --blue-tint: rgba(76,142,240,.12);
  --ink: #E8EEF6; --ink-2: #C9D4E3; --muted: #A9B7CA; --line: #2A4262; --line-2: #36507A;
  --surface: #183052; --surface-2: #1B365C; --surface-3: #22406A; --input: #13263D; --bg: #0F2136; --accent-ink: #9CC3F7;
  --ok: #86EFAC; --ok-soft: rgba(34,197,94,.18); --bad: #FCA5A5; --bad-soft: rgba(239,68,68,.20); --wait: #C4B5FD; --wait-soft: rgba(139,92,246,.22);
  --orange-ink: #FDBA74; --orange-soft: rgba(249,115,22,.18);
  color: var(--ink);
}
:root[data-theme="mid"] .side { background: var(--navy) !important; border-right: 0 !important; }
:root[data-theme="mid"] .side .navbtn[aria-current="page"] { background: rgba(76,142,240,.20) !important; box-shadow: inset 3px 0 0 #4C8EF0 !important; color: #fff !important; }
:root[data-theme="mid"] .side .navbtn > svg { color: #9CC3F7; }
:root[data-theme="mid"] .side .quick { background: #2F6FD0; color: #fff; }
:root[data-theme="mid"] .side .themeseg button[aria-pressed="true"] { background: #24426A; color: #fff; }
:root[data-theme="mid"] .pane-list { background: var(--glow) !important; }
:root[data-theme="mid"] .pane-list .tcard, :root[data-theme="mid"] .tcard { background: #FFFFFF; border-color: var(--line); box-shadow: 0 1px 2px rgba(15,33,54,.06); }
:root[data-theme="mid"] .pane-list .tcard[aria-current="true"], :root[data-theme="mid"] .tcard[aria-current="true"] { border-color: var(--blue); background: #F5F9FE; box-shadow: inset 4px 0 0 var(--blue), 0 2px 8px rgba(15,33,54,.10); }
:root[data-theme="mid"] .pane-detail .dhead { background: linear-gradient(180deg, var(--navy), var(--navy-2)) !important; border-bottom: 0 !important; }
:root[data-theme="mid"] .pane-detail .dhead .num { color: #9CC3F7 !important; }
:root[data-theme="mid"] .tg.pr-high { color: #B45309; }
:root[data-theme="mid"] .dhead .tg.pr-high { color: #FBBF24; background: rgba(245,158,11,.18); }
:root[data-theme="mid"] .pane-detail .view, :root[data-theme="mid"] .pane-detail { background: #E9EEF4; }
:root[data-theme="mid"] .msg.M { background: #FFFFFF; }
:root[data-theme="mid"] .composer { background: #F6F8FB; border-top-color: var(--line); }
:root[data-theme="mid"] .aside { background: #E1E7EF; border-left-color: var(--line); }
:root[data-theme="mid"] .as-card { background: #FFFFFF; }
:root[data-theme="mid"] .as-card h4 { color: var(--blue); }
/* Celular */
:root[data-theme="mid"] .lhead { background: linear-gradient(180deg, var(--navy) 0, var(--navy-2) 100%); }
:root[data-theme="mid"] .lhead .tab { background: #FFFFFF; border-color: #FFFFFF; color: #16202C; }
:root[data-theme="mid"] .lhead .tab[aria-pressed="true"] { background: #DCE8F5; border-color: #9CC3F7; color: #0E4F8A; }
@media (min-width: 1024px) { :root[data-theme="mid"] .lhead { background: transparent; } }
:root[data-theme="mid"] .lhead .tabs, :root[data-theme="mid"] .lhead .search { --ink: #16202C; --muted: #58667A; --surface: #FFFFFF; --line: #D3DBE6; --line-2: #BBC6D4; --input: #FFFFFF; }
:root[data-theme="mid"] .topbar { background: transparent; }
:root[data-theme="mid"] .topbar .icon-btn { background: rgba(255,255,255,.08); border-color: #2A4262; color: #E8EEF6; }
:root[data-theme="mid"] .bottomnav { background: var(--navy) !important; border-top: 0 !important; }
:root[data-theme="mid"] .bottomnav a, :root[data-theme="mid"] .bottomnav button { color: #A9B7CA; }
:root[data-theme="mid"] .bottomnav [aria-current] { color: #fff; }
:root[data-theme="mid"] .fab { background: #0E4F8A; }
:root[data-theme="mid"] .sheet { --surface: #FFFFFF; }

.tm-row.tm-3 .tm-opt .radio { display: none; }
.tm-row.tm-3 .tm-opt { justify-content: center; flex-direction: column; gap: 4px; min-height: 64px; }
.tm-row.tm-3 .tm-opt span { flex: none; align-items: center; }
@media (min-width: 1024px) { :root[data-theme="mid"] .topbar { --bg: #FFFFFF; --ink: #16202C; --ink-2: #253243; --muted: #58667A; --surface: #FFFFFF; --input: #FFFFFF; --line: #D3DBE6; --line-2: #BBC6D4; --accent-ink: #0E4F8A; color: var(--ink); } }
:root[data-theme="mid"] .lhead .search input { color: #16202C; }

/* 1.9.1 — vista previa de PDF antes de enviar */
.chipfile.pdf .pv { background: #d93a3a; }
.chipfile.pdf span small { color: var(--muted, #6b7280); }

/* 1.9.4 — vencimiento en pausa (Esperando cliente) y plan SLA en el panel */
.as-pause { color: var(--muted, #6b7280); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.as-pause svg { width: 14px; height: 14px; }
.as-sla { color: var(--muted, #6b7280); font-size: .92em; }

/* 1.10.0 — Ticket completo (empresa, contacto, copias, prioridad, asignación, vencimiento) y selector Rápido | Completo */
.qmodes { padding: 10px 16px 0; max-width: 640px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.fullform { max-width: 640px; gap: 14px; margin: 0 auto; box-sizing: border-box; }
.fcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.fcard > h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.fcard .results:empty { display: none; }
.fcard .selected-client .avatar svg { width: 18px; height: 18px; }
.check.sm { min-height: 36px; font-size: 13px; color: var(--ink-2); }
.check.sm input { width: 18px; height: 18px; }
.priogrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qprio { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); text-align: left; cursor: pointer; font: inherit; }
.qprio span { display: flex; flex-direction: column; min-width: 0; }
.qprio b { font-size: 14px; font-weight: 600; }
.qprio small { font-size: 11px; color: var(--muted); }
.qprio > svg { width: 18px; height: 18px; }
.qprio.pr-emergency > svg { color: var(--bad); }
.qprio.pr-high > svg { color: #F59E0B; }
.qprio.pr-normal > svg { color: var(--ok); }
.qprio.pr-low > svg { color: var(--muted); }
.qprio[aria-pressed="true"] { border-color: var(--accent-ink); background: var(--blue-soft); }
.qprio[aria-pressed="true"] b { color: var(--accent-ink); }
.ccchips { display: flex; flex-wrap: wrap; gap: 6px; }
.ccchip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 8px 0 12px; border-radius: 17px; border: 0;
  background: var(--blue-soft); color: var(--accent-ink); font: 600 13px Poppins, sans-serif; cursor: pointer; }
.ccchip svg { width: 14px; height: 14px; }
.ccchip:hover { background: var(--bad-soft); color: var(--bad); }
.plan { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 14px; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; }
.plan-row > span:first-child { color: var(--muted); }
.plan-row b { font-weight: 600; text-align: right; }
.plan-row.col { flex-direction: column; align-items: stretch; padding: 10px 0; gap: 8px; }
.plan-v { display: flex; align-items: center; gap: 10px; text-align: right; }
.plan-due { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.plan-due .hint svg { width: 13px; height: 13px; vertical-align: -2px; }
.hint .tg { vertical-align: 1px; margin-right: 4px; }
@media (min-width: 1000px) {
  .qmodes { max-width: 1180px; }
  .fullform { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 18px; padding-top: 22px; }
  .fside { position: sticky; top: 72px; }
}

/* 1.10.2 — Personas en copia (CC) en el ticket */
.as-cc { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.as-cc-l { color: var(--muted); flex: none; }
.as-cc-v { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.as-cc-v i { color: var(--muted); }
.as-ccname { background: var(--blue-soft); color: var(--accent-ink); border-radius: 10px; padding: 1px 8px; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-cc .linkbtn { font-size: 13px; flex: none; }
.ccbadge { cursor: pointer; gap: 4px; font: inherit; }
.ccbadge svg { width: 13px; height: 13px; }
.ccsheet { display: flex; flex-direction: column; gap: 10px; }
.ccsheet h2 { margin-bottom: 0; }
.ccsheet .hint { margin: 0; }
.cclist { display: flex; flex-direction: column; gap: 6px; }
.ccrow { display: flex; align-items: center; gap: 12px; padding: 6px 4px 6px 10px; border: 1px solid var(--line); border-radius: 12px; }
.ccrow .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ccrow .who span { font-size: 14px; font-weight: 500; }
.ccrow .who small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccrow .icon-btn:hover { color: var(--bad); background: var(--bad-soft); }
.ccsheet .results { max-height: 240px; overflow: auto; }

/* 1.10.3 — Cancelar en el ticket nuevo y copias como ícono + número */
.qacts { display: flex; gap: 10px; }
.qacts .btn { flex: 1; }
.qacts .btn[type="submit"] { flex: 2; }
.as-cc { align-items: center; }
.as-cc-l { flex: 1; }
.ccbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 17px; border: 0; cursor: pointer;
  background: var(--blue-soft); color: var(--accent-ink); font: 600 14px Poppins, sans-serif; }
.ccbtn svg { width: 17px; height: 17px; }
.ccbtn:hover { filter: brightness(.96); }
.ccbtn.none { background: transparent; border: 1.5px dashed var(--line-2); color: var(--muted); font-weight: 500; font-size: 13px; }
.ccbtn.none:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
.ccbadge svg { color: var(--accent-ink); }
.ccbadge { color: var(--accent-ink); border-color: var(--blue-soft); background: var(--blue-soft); font-weight: 600; }

/* 1.10.5 — PC: barra de búsqueda y orden fija arriba de la lista; se esconde al bajar (o fija con el pin) */
.pinbtn { display: none; }
@media (min-width: 1024px) {
  .pane-list .lhead { position: sticky; top: 0; z-index: 6; background: var(--surface); transition: transform .22s ease; will-change: transform; }
  .pane-list .qrow { position: sticky; top: var(--lhh, 86px); z-index: 5; background: var(--surface); margin: 0; padding: 6px 16px 10px;
    transition: transform .22s ease; will-change: transform; box-shadow: 0 1px 0 var(--line); }
  .pane-list .lhead.hide { transform: translateY(-100%); }
  .pane-list .qrow.hide { transform: translateY(calc(-100% - var(--lhh, 86px))); box-shadow: none; }
  .pinbtn { display: inline-flex; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); flex: none; }
  .pinbtn svg { width: 17px; height: 17px; transform: rotate(35deg); transition: transform .15s ease; }
  .pinbtn[aria-pressed="true"] { background: var(--blue-soft); color: var(--accent-ink); }
  .pinbtn[aria-pressed="true"] svg { transform: none; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) { .pane-list .lhead, .pane-list .qrow { transition: none; } }
@media (min-width: 1024px) { :root[data-theme="mid"] .pane-list .lhead, :root[data-theme="mid"] .pane-list .qrow { background: var(--surface); } }

/* 1.10.7 — escritorio: espacio entre la barra y el primer ticket; celular: filtros con más aire */
@media (min-width: 1024px) {
  .pane-list .qrow { gap: 8px; padding: 8px 16px 12px; }
  /* Espacio entre la barra de búsqueda y el primer ticket */
  .pane-list .list { padding-top: 14px; }
}
@media (max-width: 1023px) {
  .qrow { margin: 14px 16px 10px; }
}

/* 1.10.8 — el conteo de tickets también se ve al filtrar por agente (celular y tableta) */
@media (max-width: 1023px) {
  .qrow.hasagent .qcount { display: block; flex: 1; min-width: 0; }
  .qrow.hasagent { justify-content: flex-start; }
  .qrow.hasagent .agentbtn span { max-width: 96px; }
}

/* 1.12.0 — Enlace para el cliente */
.clsheet .cclist { gap: 10px; }
.clrow { display: flex; flex-direction: column; gap: 6px; }
.clacts { display: flex; gap: 6px; }
.clacts .btn { flex: 1; min-height: 40px; gap: 6px; font-size: 13px; padding: 0 8px; }
.clacts .btn svg { width: 16px; height: 16px; }
.clacts .btn.wa { color: #15803D; }
.clacts .btn:disabled { opacity: .45; }
.clacts .btn.soft { background: var(--blue-soft); color: var(--accent-ink); }
.clacts .btn.soft.wa { background: #DCFCE7; color: #15803D; }
:root[data-theme="dark"] .clacts .btn.soft.wa, :root[data-theme="mid"] .clacts .btn.soft.wa { background: rgba(34,197,94,.16); color: #4ADE80; }

/* 1.12.1 — Desde cuándo está en copia */
.ccrow .who small.ccsince { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; align-self: flex-start; max-width: 100%;
  font-size: 11px; font-weight: 500; color: var(--accent-ink); background: var(--blue-soft); border-radius: 8px; padding: 1px 7px; }
.ccrow .who small.ccsince svg { width: 11px; height: 11px; flex: none; }
.ccrow .who small.ccsince.start { color: var(--muted); background: var(--surface-3); }

/* 1.12.9 — Encabezado del ticket en celular: los botones (actualizar y ⋮) nunca se salen de la pantalla */
.dhead .row { min-width: 0; }
.dhead .row > .icon-btn { flex: none; }
.dhead .row > .num { flex: none; }
.dhead .row > .tg { min-width: 0; flex: 0 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dhead .row > .tg svg { flex: none; }
@media (max-width: 430px) {
  .dhead .row { gap: 6px; }
  .dhead .row > .tg.reop { padding-left: 7px; padding-right: 7px; }
  .dhead .row > .tg.reop .tg-l { display: none; }   /* solo el ícono ↻ (el texto queda en el título) */
}

/* 1.14.0 — Cotizar: calculadora rápida */
.side a.navbtn { text-decoration: none; }
.calcview { background: var(--bg); min-height: 100vh; }
.calc { max-width: 1080px; margin: 0 auto; padding: 16px 16px 120px; display: flex; flex-direction: column; gap: 16px; }
.calc-form { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.calc-form .field small, .calcadm small { font-weight: 400; color: var(--muted); }
.calc .crow, .calcadm .crow { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.calc .crow .field, .calcadm .crow .field { flex: 1 1 140px; min-width: 0; }
.calc .crow .field.grow { flex: 3 1 200px; }
.calc .input.big { font-size: 20px; font-weight: 600; }
.calc .seg button { padding: 0 12px; white-space: nowrap; }
.calc .pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.calc .pills.off .pill { opacity: .45; }
.calc .pill { min-height: 42px; min-width: 56px; padding: 0 12px; border-radius: 21px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 500; cursor: pointer; }
.calc .pill[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.calc .pill-other .input { width: 96px; min-height: 42px; }
.calc .chip small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.calc .chip[aria-pressed="true"] small { color: inherit; }
.calc-res { background: var(--blue); color: #fff; border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.cr-main { display: flex; flex-direction: column; gap: 8px; }
.cr-l { font-size: 13px; opacity: .85; }
.cr-big { font-size: 44px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cr-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cr-split span, .cr-total { background: rgba(255,255,255,.12); border-radius: 12px; padding: 9px 12px; font-size: 12px; display: flex; flex-direction: column; }
.cr-split b, .cr-total b { font-size: 17px; font-variant-numeric: tabular-nums; }
.cr-total { flex-direction: row; justify-content: space-between; align-items: center; font-size: 13px; }
.cr-gain { background: #DCFCE7; color: #14532D; border-radius: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; font-size: 13px; font-weight: 500; }
.cr-gain b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cr-gain b small { font-size: 13px; font-weight: 600; }
.cr-gain .cr-gt { flex-basis: 100%; text-align: right; }
.cr-gain .cr-gt b { font-size: 15px; }
.cr-gain.low { background: #FFEDD5; color: #7C2D12; }
.cr-gain.bad { background: #FEE2E2; color: #7F1D1D; }
.cr-warn { margin: 0; font-size: 13px; font-weight: 600; color: #FED7AA; }
.cr-note { margin: 0; font-size: 12px; opacity: .85; line-height: 1.5; }
.cr-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.cr-acts .btn { flex: 1 1 120px; white-space: nowrap; background: #fff; color: var(--blue); border: 0; }
.cr-acts .btn.ghost { background: rgba(255,255,255,.14); color: #fff; }
.cr-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 20px 8px; font-size: 14px; opacity: .9; }
.cr-empty svg { width: 34px; height: 34px; opacity: .8; }
.cr-empty p { margin: 0; }
.calc-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 14px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--blue); color: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.18); }
.calc-bar span { display: flex; flex-direction: column; line-height: 1.15; }
.calc-bar span:first-child { flex: 1; }
.calc-bar small { font-size: 11px; opacity: .85; }
.calc-bar b { font-size: 20px; font-variant-numeric: tabular-nums; }
.calc-bar .low b { color: #FED7AA; } .calc-bar .bad b { color: #FECACA; }
.calc-bar .btn { min-height: 44px; padding: 0 14px; background: #fff; color: var(--blue); border: 0; }
.calcadm { display: flex; flex-direction: column; gap: 12px; }
.adm-cats { display: flex; flex-direction: column; gap: 8px; }
.adm-cat { display: flex; gap: 8px; align-items: center; }
.adm-cat .input { flex: 1; min-width: 0; }
.adm-cat .input.pct { flex: 0 0 76px; }
.adm-acc { display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 900px) {
  .calc { flex-direction: row; align-items: flex-start; padding-bottom: 40px; }
  .calc-form { flex: 1 1 560px; min-width: 0; }
  .calc-res { flex: 0 0 360px; position: sticky; top: 76px; }
  .calc-bar { display: none; }
}
:root[data-theme="dark"] .calc-res, :root[data-theme="dark"] .calc-bar { background: #0F3A63; }
:root[data-theme="dark"] .cr-acts .btn:not(.ghost), :root[data-theme="dark"] .calc-bar .btn { color: #0F3A63; }

/* 1.14.2 — Margen con barra deslizante (10% a 40%, de uno en uno) */
.calc .mslider { --p: .5; }
.calc .mslider.off { opacity: .45; }
.calc .ms-row { display: flex; align-items: flex-start; gap: 14px; }
.calc .ms-track { flex: 1; min-width: 0; position: relative; padding-bottom: 22px; }
.calc .ms-track input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; }
.calc .ms-track input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px;
  background: linear-gradient(to right, var(--blue) 0, var(--blue) calc(var(--p) * 100%), var(--line-2) calc(var(--p) * 100%)); }
.calc .ms-track input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: var(--line-2); }
.calc .ms-track input[type=range]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--blue); }
.calc .ms-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.calc .ms-track input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.calc .ms-track input[type=range]:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; border-radius: 8px; }
.calc .ms-ticks { position: absolute; left: 14px; right: 14px; top: 30px; height: 22px; pointer-events: none; }
.calc .ms-ticks span { position: absolute; left: calc(var(--t) * 100%); transform: translateX(-50%); font-size: 12px; color: var(--muted); padding-top: 8px; font-variant-numeric: tabular-nums; }
.calc .ms-ticks span::before { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 6px; border-radius: 1px; background: var(--line-2); transform: translateX(-50%); }
.calc .ms-val { display: flex; align-items: center; gap: 4px; flex: none; font-size: 18px; font-weight: 700; color: var(--accent-ink); }
.calc .ms-val .input { width: 76px; min-height: 44px; text-align: center; font-size: 20px; font-weight: 700; color: var(--accent-ink); }

/* 1.15.0 — Servicios, paquetes y suma rápida */
.calc2 { max-width: 1080px; margin: 0 auto; padding: 0 16px 120px; display: flex; flex-direction: column; gap: 16px; }
.calc .cr-acts .btn[data-c="sumadd"] { background: #DCFCE7; color: #14532D; }
.calc-svcs, .calc-sum { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cs-head { display: flex; align-items: center; gap: 10px; }
.cs-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.cs-head .tag { display: inline-flex; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cs-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 60px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.cs-item b { font-weight: 600; }
.cs-item small { color: var(--muted); font-size: 12px; }
.cs-item.kit { border-color: var(--accent-ink); background: var(--blue-tint); }
.cs-item:hover { border-color: var(--accent-ink); }
.sum-list { display: flex; flex-direction: column; }
.sum-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 40px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sum-n { display: flex; flex-direction: column; min-width: 0; }
.sum-n b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.sum-n small, .sum-q { font-size: 12px; color: var(--muted); }
.sum-i, .sum-q { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-row .icon-btn { width: 40px; height: 40px; }
.sum-tot { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.sum-tot span { display: flex; justify-content: space-between; color: var(--muted); }
.sum-tot b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sum-tot .big { font-size: 17px; color: var(--ink); font-weight: 600; border-top: 1px solid var(--line); padding-top: 6px; }
.sum-tot .big b { font-weight: 700; }
.cr-acts2 { display: flex; gap: 8px; flex-wrap: wrap; }
.cr-acts2 .btn { flex: 1 1 140px; white-space: nowrap; }
.btn.ghost.danger { color: var(--bad); border-color: var(--bad); }
.svcpick, .svcedit { display: flex; flex-direction: column; gap: 12px; }
.svcpick .hint, .svcedit .hint { margin: 0; }
.svcedit small, .svcpick small { font-weight: 400; color: var(--muted); }
.stepper { display: flex; gap: 8px; align-items: center; }
.stepper .input { width: 96px; text-align: center; font-size: 18px; font-weight: 600; }
.stepper .icon-btn { font-size: 22px; font-weight: 600; border: 1px solid var(--line-2); }
.sp-res { background: var(--blue-tint); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.sp-res > div { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.sp-res b { font-variant-numeric: tabular-nums; color: var(--ink); }
.sp-res .big { font-size: 18px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 6px; }
.sp-res .big b { font-weight: 700; color: var(--accent-ink); }
.sp-res > small { color: var(--ok); font-weight: 600; }
.se-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ke-items { display: flex; flex-direction: column; gap: 8px; }
.ke-it { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.ke-n { flex: 1 1 160px; display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.ke-n small { font-size: 12px; }
.ke-it select.input { width: auto; min-height: 40px; }
.ke-it .input.qty { width: 70px; min-height: 40px; text-align: center; }
.svc-page { max-width: 900px; margin: 0 auto; padding: 16px 16px 60px; display: flex; flex-direction: column; gap: 18px; }
.svc-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.svc-acts .hint { margin: 0; flex: 1 1 260px; }
.svc-cat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.svc-cat h2 { margin: 0; padding: 12px 16px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--accent-ink); background: var(--surface-2); text-transform: uppercase; }
.svc-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.svc-row:hover { background: var(--blue-tint); }
.svc-n { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.svc-n b { font-weight: 600; }
.svc-n small { font-size: 12px; color: var(--muted); }
.svc-p { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.svc-row .chev { width: 16px; height: 16px; color: var(--muted); }
.star { font-style: normal; color: #D97706; }
@media (min-width: 900px) {
  .calc2 { flex-direction: row; align-items: flex-start; padding-bottom: 40px; }
  .calc-svcs { flex: 1 1 560px; }
  .calc-sum { flex: 0 0 360px; position: sticky; top: 76px; }
}

/* 1.15.1 — Cotizar en 4 pasos: calculadora → agregar producto → agregar servicio (buscador) → conceptos */
.cz { width: 100%; min-width: 0; box-sizing: border-box; max-width: 1320px; margin: 0 auto; padding: 16px 16px 110px; display: flex; flex-direction: column; gap: 16px; }
.cz-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cz-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cz-h { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cz-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; letter-spacing: 0; }
.cz-h .tag { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.cz .calc { max-width: none; margin: 0; padding: 0; }
.cz .calc-form { border: 0; padding: 0; background: transparent; border-radius: 0; }
.cz-prod { display: flex; flex-direction: column; gap: 12px; }
.cz-prod small { font-weight: 400; color: var(--muted); }
.cz-g3 > *, .cz-g4 > * { min-width: 0; }
.cz-g3, .cz-g4 { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.cz-g3 > :nth-child(3), .cz-g4 > :nth-child(2) { grid-column: span 2; }
.cz-pp { display: flex; flex-direction: column; justify-content: center; min-height: 48px; gap: 0; }
.cz-pp b { font-size: 19px; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.cz-pp .label { margin: 0; }
.btn.cz-add { background: #1F8A4C; } .btn.cz-add:hover { background: #166D3B; }
.cz-search { position: relative; }
.cz-search .cz-si { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; }
.cz-search .cz-si svg { width: 18px; height: 18px; }
.cz-search .input { padding-left: 40px; }
.cz-chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px 2px; }
.cz-chips::-webkit-scrollbar { display: none; }
.cz-chips .chip { flex: none; }
.cz .cs-grid { grid-template-columns: minmax(0, 1fr); }
.cz .cs-item { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; }
.csi-n { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.csi-p { color: var(--accent-ink); white-space: nowrap; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cz mark { background: #FEF08A; color: inherit; border-radius: 3px; padding: 0 1px; }
.cz-none { margin: 4px 0; }
.ktag { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .03em; border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.ktag.kp { background: var(--blue-soft); color: var(--accent-ink); }
.ktag.ks { background: var(--ok-soft); color: var(--ok); }
.ktag.kk { background: #EDE4FB; color: #6A3DB0; }
:root[data-theme="dark"] .ktag.kk { background: rgba(139,92,246,.22); color: #C4B5FD; }
.calc-sum .sum-row { grid-template-columns: minmax(0, 1fr) auto 40px; align-items: start; padding: 10px 0; }
.calc-sum .sum-row .sum-i { padding-top: 2px; }
.calc-sum .sum-n b { white-space: normal; }
.sum-n .sum-priv { color: var(--ok); }
.sum-tot .sum-g { font-size: 12.5px; color: var(--ok); } .sum-tot .sum-g b { color: var(--ok); }
.btn.cz-create { width: 100%; }
.cz-foot { margin: 0; font-size: 12px; text-align: center; }
.czsheet .calc-sum { border: 0; padding: 0; background: transparent; border-radius: 0; }
.czsheet .sheet { gap: 12px; }
@media (min-width: 640px) {
  .cz-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cz-g3 > :nth-child(3) { grid-column: auto; }
  .cz-g4 { grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) auto; } .cz-g4 > :nth-child(2) { grid-column: auto; }
  .cz .cs-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .cz-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
}
@media (min-width: 900px) {
  .cz .calc { flex-direction: row; padding-bottom: 0; }
  .cz .calc-res { flex: 0 0 330px; top: 76px; }
  .calcview .calc-bar:not([hidden]) { display: flex; }
}
@media (max-width: 1179px) { .cz-side { display: none !important; } }
@media (min-width: 1180px) {
  .cz { flex-direction: row; align-items: flex-start; padding-bottom: 40px; }
  .cz-main { flex: 1 1 auto; }
  .cz-side { flex: 0 0 400px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
  .calcview .calc-bar { display: none !important; }
}

/* 1.15.2 — Moneda e IVA en un toque, editar conceptos, descuentos */
.cost-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.cost-row .input { flex: 1 1 160px; min-width: 0; }
.tgl { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tgl svg { width: 16px; height: 16px; color: var(--muted); }
.tgl.alt { background: #FFF1E3; border-color: #F0A35E; color: #9A4A0A; }
.tgl.alt svg { color: #C2620F; }
:root[data-theme="dark"] .tgl.alt { background: rgba(240,140,46,.18); color: #FDBA74; border-color: #C2620F; }
.cz-addw { display: flex; gap: 8px; } .cz-addw .btn { flex: 1 1 auto; white-space: nowrap; }
.cz-card.editing { border-color: #F0A35E; box-shadow: 0 0 0 3px rgba(240,140,46,.18); }
.cz-card.editing #cz2t { color: #C2620F; text-transform: none; letter-spacing: 0; font-size: 14px; }
.calc-sum .sum-row { grid-template-columns: minmax(0, 1fr) auto 40px; }
.calc-sum button.sum-n { border: 0; background: transparent; color: inherit; font: inherit; text-align: left; padding: 4px 6px; margin: -4px -6px; border-radius: 10px; cursor: pointer; gap: 1px; }
.calc-sum button.sum-n:hover { background: var(--blue-tint); }
.sum-n small.sum-dsc { color: #C2620F; display: flex; align-items: center; gap: 4px; } .sum-dsc svg { width: 13px; height: 13px; }
.sum-chg { font-style: normal; color: #C2620F; }
.calc-sum .sum-i { display: flex; flex-direction: column; align-items: flex-end; }
.sum-i s { font-size: 12px; color: var(--muted); font-weight: 400; }
.sum-tot .sum-gd { color: #C2620F; } .sum-tot .sum-gd b { color: #C2620F; }
.sum-tot .sum-gd .linkbtn { color: inherit; font-size: inherit; padding: 0; }
.sum-tot .sum-sv { font-size: 12.5px; color: #C2620F; } .sum-tot .sum-sv b { color: #C2620F; }
.cz-gd { align-self: flex-start; }
.cz-tip { margin: -4px 0 0; font-size: 12px; }
.disc-row { display: flex; gap: 8px; } .disc-row .seg { flex: 0 0 120px; } .disc-row .input { flex: 1; min-width: 0; }
.czedit { display: flex; flex-direction: column; gap: 12px; }
.czedit-b { display: flex; flex-direction: column; gap: 12px; }
.czedit .hint { margin: 0; } .czedit small { font-weight: 400; color: var(--muted); }
.czedit .btn.ghost small { color: inherit; opacity: .8; }
.sp-prev { margin: 0; background: var(--blue-tint); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.sp-prev:empty { display: none; }
.sp-prev s { color: var(--muted); } .sp-prev .ok { color: var(--ok); font-weight: 600; } .sp-prev .bad { color: var(--bad); font-weight: 600; }

/* 1.15.3 — Calculadora más compacta: costo + MXN/USD + IVA + cantidad en una fila; paquetería y precio objetivo opcionales; redondeo en el cuadro azul */
.cost-grid { display: grid; grid-template-columns: minmax(0, 1fr) 68px; gap: 6px 8px; align-items: end; }
.cost-grid .label { margin: 0; }
.cost-grid .cost-row { flex-wrap: nowrap; gap: 6px; }
.cost-grid .cost-row .input { flex: 1 1 auto; min-width: 0; }
.cost-grid .tgl { padding: 0 12px; min-width: 58px; justify-content: center; }
.cost-grid .c-qty { text-align: center; font-size: 18px; font-weight: 600; padding: 0 6px; min-width: 0; }
.opt-row { display: flex; gap: 6px; align-items: center; } .opt-row .input { flex: 1; min-width: 0; }
.opt-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: -4px; }
.opt-links .linkbtn { font-size: 14px; font-weight: 600; padding: 4px 0; }
.cr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cr-round { flex: none; min-height: 34px; padding: 0 12px; border-radius: 17px; border: 1.5px solid rgba(255,255,255,.55); background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cr-round.on { background: #fff; color: var(--blue); border-color: #fff; }
:root[data-theme="dark"] .cr-round.on { color: #0F3A63; }
@media (max-width: 380px) { .cost-grid .tgl { padding: 0 8px; min-width: 50px; font-size: 13px; } .cost-grid { grid-template-columns: minmax(0, 1fr) 56px; } }
.opt-links .linkbtn { text-decoration: none; }

/* 1.15.4 — Envío a domicilio en los conceptos */
.cz-extra { display: flex; flex-wrap: wrap; gap: 8px; }
.sum-tot .sum-home .linkbtn { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 500; text-decoration: none; padding: 0; }
.sum-tot .sum-home svg, .cz-extra svg { width: 16px; height: 16px; }
.opt-row .icon-btn { flex: none; width: 44px; height: 44px; border: 1px solid var(--line-2); color: var(--muted); }
.opt-row .icon-btn svg { width: 18px; height: 18px; }

/* 1.15.6 — Agregar al catálogo lo que buscaste */
.svc-new { background: var(--blue-tint); border: 1px solid var(--blue-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.cz-none .linkbtn { font-weight: 600; }

/* 1.16.0 — Cotizaciones: pestañas, lista, editor con vista previa, ajustes del documento */
.cz-tabs { display: flex; gap: 2px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; overflow-x: auto; scrollbar-width: none; }
.cz-tabs a { flex: none; padding: 12px 14px 11px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; border-bottom: 3px solid transparent; }
.cz-tabs a[aria-current="page"] { color: var(--accent-ink); font-weight: 600; border-bottom-color: var(--blue); }
@media (min-width: 900px) { .cz-tabs { justify-content: center; } }
.qst { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; }
.qst.s0 { background: var(--surface-2); color: var(--ink-2); } .qst.s1 { background: var(--blue-soft); color: var(--accent-ink); }
.qst.s2 { background: #FEF3C7; color: #92400E; } .qst.s3 { background: #DCFCE7; color: #15803D; } .qst.s4 { background: #FEE2E2; color: #B91C1C; }
.qst.s5 { background: #EDE4FB; color: #6A3DB0; } .qst.s6 { background: #D1FAE5; color: #065F46; } .qst.s7 { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
:root[data-theme="dark"] .qst.s2 { background: rgba(234,179,8,.18); color: #F5D27A; } :root[data-theme="dark"] .qst.s3, :root[data-theme="dark"] .qst.s6 { background: rgba(34,197,94,.16); color: #86EFAC; }
:root[data-theme="dark"] .qst.s4 { background: rgba(239,68,68,.18); color: #FCA5A5; } :root[data-theme="dark"] .qst.s5 { background: rgba(139,92,246,.2); color: #C4B5FD; }
.btn.wa { background: #1FA855; color: #fff; } .btn.wa:hover { background: #178A45; }
.ql { max-width: 900px; margin: 0 auto; padding: 16px 16px 90px; display: flex; flex-direction: column; gap: 12px; }
.ql-top { display: flex; gap: 10px; align-items: center; } .ql-top .cz-search { flex: 1; min-width: 0; }
.ql .cz-chips { margin: 0 -16px; padding: 0 16px 2px; }
.ql-list { display: flex; flex-direction: column; gap: 10px; }
.qi { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.qi:hover { border-color: var(--accent-ink); }
.qi-r { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qi-f { font-size: 16px; font-weight: 700; color: var(--accent-ink); } .qi-c { font-size: 14.5px; font-weight: 600; } .qi small { color: var(--muted); font-size: 12.5px; }
.qi-t { font-size: 15px; font-variant-numeric: tabular-nums; }
.qhead { flex-wrap: wrap; gap: 8px; } .qhead h1 { white-space: nowrap; }
.qst-btn { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.q-saved { font-size: 12px; margin: 0; } .q-acts { display: none; gap: 8px; }
.qz { max-width: 1400px; margin: 0 auto; padding: 16px 16px 100px; display: flex; flex-direction: column; gap: 16px; width: 100%; min-width: 0; box-sizing: border-box; }
.qz-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.qz-side { display: none; }
.cz-g2 { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); } .cz-g2 > * { min-width: 0; }
.qview .seg button { white-space: nowrap; padding: 0 8px; font-size: 13.5px; }
.q-res { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 320px; overflow: auto; }
.q-res:empty { display: none; }
.q-opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.q-opt:hover { border-color: var(--accent-ink); background: var(--blue-tint); }
.q-opt span { display: flex; flex-direction: column; min-width: 0; } .q-opt small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-opt svg { width: 20px; height: 20px; color: var(--accent-ink); flex: none; }
.q-av { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-soft); color: var(--accent-ink); display: inline-flex !important; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.q-att { display: flex; gap: 6px; } .q-att .input { flex: 1; min-width: 0; }
.q-adv summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; font-size: 14px; padding: 4px 0; }
.q-adv .field { margin-top: 8px; }
.chk { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 400; color: var(--ink); }
.chk input { width: 18px; height: 18px; accent-color: var(--blue); }
.q-bans { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.q-ban { display: flex; flex-direction: column; gap: 4px; padding: 6px; min-height: 64px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; text-align: left; text-decoration: none; justify-content: center; }
.q-ban img { width: 100%; height: 38px; object-fit: cover; border-radius: 7px; background: var(--surface-2); }
.q-ban[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.q-ban.none, .q-ban.add { align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.q-ban.add { border-style: dashed; color: var(--accent-ink); font-weight: 600; }
.q-row .sum-n { padding: 0; }
.q-prev { height: 70vh; min-height: 520px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.q-prev iframe { width: 100%; height: 100%; border: 0; display: block; }
.q-bar { gap: 8px; } .q-bar .btn { flex: 1; } .q-bar .btn:last-child { flex: 0 0 56px; padding: 0; }
.q-bar .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.cz-link { display: flex; gap: 8px; align-items: center; background: #FFF1E3; color: #9A4A0A; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.cz-link svg { width: 16px; height: 16px; flex: none; }
:root[data-theme="dark"] .cz-link { background: rgba(240,140,46,.16); color: #FDBA74; }
.qs { max-width: 820px; margin: 0 auto; padding: 16px 16px 60px; display: flex; flex-direction: column; gap: 16px; }
.qs .cz-h small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.qs-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qs-def { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); cursor: pointer; padding: 0; }
.qs-def[aria-pressed="true"] { border: 7px solid var(--blue); }
.qs-n { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; } .qs-n small { color: var(--muted); font-size: 12px; }
.qs-ban { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .qs-ban img { width: 100%; max-height: 70px; object-fit: contain; object-position: left; border-radius: 6px; background: var(--surface-2); min-height: 30px; }
.qs-ban small { color: var(--muted); font-size: 12px; }
.qs-up { cursor: pointer; }
@media (min-width: 640px) { .cz-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .q-acts { display: inline-flex; } .calcview .q-bar { display: none !important; } .qz { padding-bottom: 40px; } }
@media (min-width: 1180px) {
  .qz { flex-direction: row; align-items: flex-start; }
  .qz-main { flex: 1 1 auto; }
  .qz-side { display: flex; flex: 0 0 470px; position: sticky; top: 76px; }
}
.q-prev { overflow: auto; }
.q-pages { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.q-pages canvas { width: 100%; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.calc-sum .q-row, .q-row { grid-template-columns: minmax(0, 1fr) auto; }
.calcview .q-bar .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
@media (max-width: 599px) { .q-saved { display: none; } .qhead h1 { font-size: 18px; } }
.ql, .qs { width: 100%; min-width: 0; box-sizing: border-box; }
.ql-top .btn { flex: none; }
@media (max-width: 599px) { .ql-top .btn { min-height: 44px; padding: 0 12px; font-size: 14px; } }

/* 1.16.2 — Link de autorización: estatus nuevos, respuestas del cliente, avisos */
.tab-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.qi.new { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.qi.new.q-autorizada { border-color: #1F8A4C; box-shadow: 0 0 0 2px #DCFCE7; } .qi.q-recotizar { border-color: #F0A35E; }
.qi-st { display: inline-flex; gap: 6px; align-items: center; }
.qi-nw { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #E5484D; border-radius: 10px; padding: 2px 8px; }
.qi-msg { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-left: 3px solid #F08C2E; border-radius: 8px; padding: 6px 10px; margin: 3px 0; }
.q-autorizada .qi-msg { border-left-color: #1F8A4C; } .q-no_autorizada .qi-msg { border-left-color: #B91C1C; }
.qi-re { font-size: 14px; text-decoration: none; }
.q-rc { border-width: 1.5px; } .q-rc.ok { border-color: #1F8A4C; } .q-rc.bad { border-color: #E7A1A1; } .q-rc.warn { border-color: #F0A35E; }
.q-rc.ok .cz-h { color: #15803D; } .q-rc.bad .cz-h { color: #B91C1C; } .q-rc.warn .cz-h { color: #C2620F; }
.q-quote { margin: 0; font-size: 15px; } .q-rc .btn { align-self: flex-start; }
.q-lk .cr-acts2 .btn { flex: 0 0 auto; }
#q-resp:empty { display: none; } #q-resp { display: flex; flex-direction: column; gap: 16px; }
.calcview .q-bar .btn.wa { background: #1FA855; color: #fff; }
/* 1.16.3 — Cotización firmada por otra persona: solo lectura */
.q-locked .qz-main section:not(.q-lk):not(.q-rc) { opacity: .85; }
.q-locked .q-ban[disabled], .q-locked .seg button[disabled] { cursor: default; }
.q-lockmsg { font-size: 13.5px; }

/* 1.16.6 — Temas en Cotizar: en "intermedio" la barra de arriba y las pestañas van en azul marino (como el resto de la app) */
:root[data-theme="mid"] .plainbar, :root[data-theme="mid"] .cz-tabs {
  --blue: #4C8EF0; --blue-dark: #2560B8; --blue-soft: rgba(76,142,240,.20); --blue-tint: rgba(76,142,240,.12);
  --ink: #E8EEF6; --ink-2: #C9D4E3; --muted: #A9B7CA; --line: #2A4262; --line-2: #36507A;
  --surface: #183052; --surface-2: #1B365C; --surface-3: #22406A; --input: #13263D; --accent-ink: #9CC3F7;
  color: var(--ink); border-bottom-color: transparent;
}
:root[data-theme="mid"] .plainbar { background: var(--navy); }
:root[data-theme="mid"] .cz-tabs { background: var(--navy-2); }
:root[data-theme="mid"] .cz-tabs a[aria-current="page"] { color: #fff; border-bottom-color: #4C8EF0; }
:root[data-theme="mid"] .plainbar .icon-btn { color: #E8EEF6; }
:root[data-theme="mid"] .plainbar .qst.s2 { background: rgba(234,179,8,.18); color: #F5D27A; }
:root[data-theme="mid"] .plainbar .qst.s3 { background: rgba(34,197,94,.16); color: #86EFAC; }
:root[data-theme="mid"] .plainbar .qst.s4 { background: rgba(239,68,68,.18); color: #FCA5A5; }
:root[data-theme="mid"] .plainbar .btn.wa { background: #1FA855; color: #fff; }
:root[data-theme="mid"] .cz-card, :root[data-theme="mid"] .qi, :root[data-theme="mid"] .svc-cat { background: #FFFFFF; box-shadow: 0 1px 2px rgba(15,33,54,.06); }
:root[data-theme="mid"] .qz-side .q-prev { background: #E1E7EF; }
:root[data-theme="dark"] .cz mark { background: rgba(250,204,21,.32); color: inherit; }
/* Cabecera de la cotización en el celular: todo en una línea */
@media (max-width: 899px) { .qhead { flex-wrap: nowrap; } .qhead h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; } }
@media (max-width: 599px) { .q-word { display: none; } .qhead h1::before { content: "Cot. "; } }
/* 1.16.7 — Cotización enviada: campos bloqueados hasta "Editar cotización" */
.q-lockbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--blue-tint); border: 1px solid var(--blue-soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--ink-2); }
.q-lockbar span { display: flex; align-items: center; gap: 8px; } .q-lockbar svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
.q-lockmsg { flex-wrap: wrap; } .q-lockmsg .btn { margin-left: auto; }
.q-locked .qz-main section:not(.q-lk):not(.q-rc) .input:disabled { background: var(--surface-2); color: var(--ink-2); -webkit-text-fill-color: var(--ink-2); opacity: 1; }
#q-lock:empty { display: none; }
/* 1.16.8 — Grupos de conceptos */
.q-grps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.q-grps .hint { margin: 0; }
.q-grp { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1.5px solid var(--blue-soft); border-radius: 14px; background: var(--blue-tint); }
.q-grp-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-grp-r > .input { flex: 1 1 200px; min-width: 0; }
.q-grp-r select.input { flex: 0 0 auto; width: auto; }
.q-gq { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.q-gq .input { width: 70px; text-align: center; font-weight: 600; }
.q-grp .chk { margin: 0; font-size: 13.5px; }
.q-ga { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 2px; color: var(--accent-ink); }
.q-ga svg { width: 14px; height: 14px; }
.q-ga select.input { min-height: 34px; padding: 0 28px 0 10px; font-size: 13px; width: auto; max-width: 100%; }
.q-row.in-grp { border-left: 3px solid var(--blue); padding-left: 8px; }
/* 1.16.10 — Recortar banner */
.bcrop { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.bcrop .hint { margin: 0; }
.bc-frame { position: relative; width: 100%; overflow: hidden; border-radius: 10px; background: repeating-conic-gradient(#E2E8F0 0% 25%, #FFFFFF 0% 50%) 0 0 / 16px 16px; cursor: grab; touch-action: none; outline: 2px solid var(--blue); outline-offset: 2px; }
.bc-frame.drag { cursor: grabbing; }
.bc-frame img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.bc-zoom { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); }
.bc-zoom input { flex: 1; accent-color: var(--blue); }
/* 1.16.13 confirmación de envío y código de autorización */
.q-confirm { margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); border: 1px solid var(--note-line); font-size: 14px; line-height: 1.45; }
.q-code { margin: 2px 0 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; color: var(--ink-2); }
.q-code b { font-size: 20px; letter-spacing: 3px; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.q-code small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
/* 1.17.0 «Esperando cliente» y código de interacción */
.wsheet { gap: 12px; }
.wpills { display: flex; flex-wrap: wrap; gap: 7px; }
.wp { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line-2); border-radius: 20px; overflow: hidden; background: var(--surface); }
.wp button { border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink-2); padding: 6px 12px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; min-height: 34px; }
.wp button svg { width: 14px; height: 14px; }
.wp:has([aria-pressed="true"]) { background: var(--blue); border-color: var(--blue); }
.wp button[aria-pressed="true"] { color: #fff; font-weight: 600; }
.wp .wx { padding: 0 9px 0 2px; color: var(--muted); }
.wp:has([aria-pressed="true"]) .wx { color: #fff; }
.wsla { display: flex; gap: 8px; align-items: center; background: var(--blue-tint); color: var(--accent-ink); border-radius: 12px; padding: 9px 12px; font-size: 12.5px; }
.wsla svg { width: 16px; height: 16px; flex: none; }
.wcode { background: var(--blue-tint); border-radius: 12px; padding: 10px 12px; margin: 4px 0 8px; }
.wcode .linkbtn { margin-left: auto; }
/* 1.17.1 ordenar partidas */
.q-row .sum-i { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.q-mv { display: inline-flex; gap: 2px; margin-top: 2px; }
.q-mv .icon-btn { width: 34px; height: 34px; min-width: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--accent-ink); }
.q-mv .icon-btn svg { width: 16px; height: 16px; }
.q-mv .icon-btn:disabled { opacity: .3; }
/* 1.17.2 menú de abajo en toda la app (celular) */
:root { --gnav-h: 0px; }
.gnav { display: none; }
@media (max-width: 1023px) {
  body.has-gnav { --gnav-h: calc(64px + var(--safe-b)); }
  body.has-gnav.bars-off, body.has-gnav.typing { --gnav-h: 0px; }
  .gnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--surface); border-top: 1px solid var(--line);
    padding: 0 4px var(--safe-b); height: calc(64px + var(--safe-b)); transition: transform .22s ease; will-change: transform; }
  .gnav[hidden] { display: none; }
  body.bars-off .gnav, body.typing .gnav { transform: translateY(calc(100% + 32px)); }
  .gnav button { flex: 1; border: 0; background: none; font: inherit; font-size: 10.5px; font-weight: 500; color: var(--muted); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; cursor: pointer; position: relative; min-width: 0; }
  .gnav .gi { position: relative; display: inline-flex; }
  .gnav svg { width: 22px; height: 22px; }
  .gnav [aria-current="page"] { color: var(--accent-ink); font-weight: 700; }
  .gnav [aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent-ink); }
  .gnav .gb { position: absolute; top: -6px; left: 14px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #DC2626; color: #fff;
    font-style: normal; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }
  .gnav .gb.o { background: #C2620F; }
  .gnav .gplus .gi { width: 50px; height: 50px; border-radius: 16px; background: var(--blue); color: #fff; align-items: center; justify-content: center;
    margin-top: -22px; box-shadow: 0 4px 12px rgba(10,74,128,.35); }
  .gnav .gplus .gi svg { width: 26px; height: 26px; }
  .gnav .gplus[aria-current="page"]::before { display: none; }
  /* lo que va pegado abajo se sube encima del menú */
  body.has-gnav .calc-bar { bottom: var(--gnav-h); transition: bottom .22s ease; }
  body.has-gnav .composer { bottom: var(--gnav-h); transition: bottom .22s ease; }
  body.has-gnav #toast { bottom: calc(var(--gnav-h) + 24px); }
  body.has-gnav .totop { bottom: calc(var(--gnav-h) + 70px); }
  body.has-gnav #app { padding-bottom: var(--gnav-h); transition: padding-bottom .22s ease; }
  /* al bajar también se esconden los encabezados */
  .dhead, .plainbar, .cz-tabs { transition: transform .22s ease; }
  body.bars-off .dhead, body.bars-off .plainbar { transform: translateY(-110%); }
  body.bars-off .cz-tabs { transform: translateY(-110%); }
  body.bars-off .lhead { transform: translateY(-110%); }
  /* resumen del día en celular */
  .shell.m-home .pane-detail { min-height: 100vh; }
}
/* hoja «Más» */
.gmore { gap: 10px; }
.gm-me { display: flex; align-items: center; gap: 10px; border: 0; background: none; font: inherit; text-align: left; padding: 4px 2px; cursor: pointer; color: var(--ink); }
.gm-me span:nth-child(2) { flex: 1; display: flex; flex-direction: column; } .gm-me small { color: var(--muted); font-size: 12px; } .gm-me > svg { width: 18px; height: 18px; color: var(--muted); }
.gm-h { margin: 6px 2px 0; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.gm-theme { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gm-theme button { flex: 1; border: 0; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; padding: 9px 2px; display: inline-flex; gap: 4px; align-items: center; justify-content: center; cursor: pointer; }
.gm-theme button svg { width: 15px; height: 15px; }
.gm-theme button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.gm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.gm-grid button { border: 1px solid var(--line); background: var(--surface-2, var(--bg)); border-radius: 13px; padding: 12px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; min-height: 52px; }
.gm-grid button svg { width: 18px; height: 18px; flex: none; color: var(--accent-ink); }
.gm-grid button span { display: flex; flex-direction: column; } .gm-grid small { font-weight: 400; font-size: 11px; color: var(--muted); }
.gm-grid .soon { opacity: .5; cursor: default; } .gm-grid .danger, .gm-grid .danger svg { color: var(--bad); }
@media (max-width: 1023px) {
  .shell.m-home .homep { padding: 18px 14px 24px; }
  .shell.m-home .homep h1 { font-size: 24px; }
  .shell.m-home .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shell.m-home .hgrid { grid-template-columns: minmax(0, 1fr); }
  .shell.m-home .qa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
}

/* ---------- 1.17.5: Herramientas ---------- */
.tshell { min-height: 100vh; min-height: 100dvh; display: flex; }
.toolsview { background: var(--bg); }
.tl-main { padding: 16px; display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 1240px; margin: 0 auto; }
.tl-intro { margin: 0 0 4px; color: var(--muted); }
.tl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tl-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 84px; }
a.tl-card:hover { border-color: var(--accent-ink); color: var(--ink); box-shadow: 0 0 0 3px var(--blue-soft); }
.tl-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-card b { font-size: 15.5px; } .tl-card small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.tl-card .go { color: var(--muted); }
.tl-card.soon { opacity: .55; border-style: dashed; }
.tl-ic { width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--blue-soft); color: var(--accent-ink); }
.tl-ic svg { width: 24px; height: 24px; }
.tl-sum, .tl-safe, .tl-link { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 13.5px; color: var(--ink-2); }
.tl-sum { margin-top: 6px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tl-sum svg, .tl-safe svg, .tl-link svg { color: var(--accent-ink); margin-top: 1px; }
.tl-safe { padding: 10px 12px; background: var(--ok-soft); border-radius: 12px; } .tl-safe svg { color: var(--ok); }
.tl-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.tl-form .input.mono { font-family: ui-monospace, Menlo, Consolas, 'Roboto Mono', monospace; letter-spacing: .02em; }
.tl-form .input.masked { -webkit-text-security: disc; }
.tl-form .opt-row { display: flex; gap: 6px; align-items: center; }
.tl-form .seg button { font-size: 12.5px; }
.tl-prev { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tl-canvas { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 18px 18px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; place-items: center; }
.tl-canvas canvas { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 2px 12px rgba(10,30,60,.18); background: #fff; }
.tl-canvas.lbl canvas { max-width: 420px; border-radius: 3px; }
.tl-size { text-align: center; }
.tl-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.tl-actions .btn { min-height: 46px; font-size: 14px; padding: 0 10px; }
.tl-actions .btn svg { width: 18px; height: 18px; }
.tl-open { align-self: center; font-size: 14px; }
.tl-ph { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: 16px; }
.tl-ph svg { width: 44px; height: 44px; color: var(--line-2); } .tl-ph small { display: block; margin-top: 6px; }
.tl-ph.err { color: var(--bad); border-color: var(--bad); } .tl-ph.err svg { color: var(--bad); }
.tl-load { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); padding: 10px; } .tl-load .spinner { margin: 16px auto 8px; }
.tl-search { height: 48px; padding: 0 12px; }
.tl-res { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.tl-sub { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tl-tk { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.tl-tk:hover { border-color: var(--accent-ink); }
.tl-tk.on { border-color: var(--accent-ink); background: var(--blue-tint); box-shadow: inset 3px 0 0 var(--blue); }
.tl-tk .n { font-weight: 700; color: var(--accent-ink); font-size: 13px; flex: none; padding-top: 1px; }
.tl-tk .s { display: flex; flex-direction: column; min-width: 0; } .tl-tk b { font-weight: 500; font-size: 14px; } .tl-tk small { color: var(--muted); font-size: 12.5px; }
/* Tiempo */
.tl-time-wrap { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 620px; margin: 0 auto; }
.tl-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tl-seg button svg { width: 17px; height: 17px; }
.tl-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--ink-2); font-size: 13.5px; }
.tl-note > span { flex: 1 1 220px; } .tl-note svg { color: var(--warn); }
.tl-hms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tl-hms label { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.tl-hms .input { text-align: center; font-size: 26px; font-weight: 600; min-height: 62px; }
.tl-alrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .tl-alrow .chk { margin: 0; }
.tl-time { width: auto; min-width: 170px; font-size: 28px; font-weight: 600; min-height: 62px; }
.tl-list { display: flex; flex-direction: column; gap: 8px; } .tl-list:empty { display: none; }
.tl-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tl-row .tl-ic { width: 40px; height: 40px; border-radius: 11px; } .tl-row .tl-ic svg { width: 21px; height: 21px; }
.tl-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-rt b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; } .tl-rt small { color: var(--muted); font-size: 12.5px; }
.tl-row .icon-btn { width: 40px; height: 40px; font-weight: 700; font-size: 13px; color: var(--accent-ink); }
.tl-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.tl-bar i { display: block; height: 100%; background: var(--blue); transition: width .5s linear; }
.tl-row.off { opacity: .6; }
.tgl-sw { position: relative; width: 46px; height: 28px; flex: none; cursor: pointer; }
.tgl-sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tgl-sw i { position: absolute; inset: 0; border-radius: 14px; background: var(--line-2); transition: background .15s; }
.tgl-sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.tgl-sw input:checked + i { background: var(--blue); } .tgl-sw input:checked + i::after { transform: translateX(18px); }
.tgl-sw input:focus-visible + i { outline: 3px solid #7FB0DE; outline-offset: 2px; }
.tl-sw { align-items: center; }
.tl-big { font-size: clamp(52px, 15vw, 88px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; padding: 12px 0; color: var(--ink); }
.tl-swb { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; width: 100%; }
.tl-laps { list-style: none; margin: 0; padding: 0; width: 100%; max-height: 300px; overflow: auto; border-top: 1px solid var(--line); }
.tl-laps li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; font-size: 14px; }
.tl-laps small { color: var(--muted); min-width: 84px; text-align: right; }
.tl-foot { text-align: center; }
/* Aviso que suena */
.ring-wrap { position: fixed; inset: 0; z-index: 9000; background: rgba(6,20,40,.62); display: grid; place-items: center; padding: 20px; animation: ringIn .2s ease-out; }
.ring-card { width: 100%; max-width: 420px; max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 22px; padding: 8px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.ring-it { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 0; }
.ring-it + .ring-it { border-top: 1px solid var(--line); }
.ring-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-ink); animation: ringShake 1.6s ease-in-out infinite; }
.ring-ic svg { width: 38px; height: 38px; }
.ring-it h2 { margin: 6px 0 0; font-size: 21px; } .ring-it p { margin: 0; color: var(--muted); font-size: 14px; }
.ring-b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; width: 100%; margin-top: 12px; }
@keyframes ringIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ringShake { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .ring-ic, .ring-wrap { animation: none; } }
/* Píldora del temporizador en toda la app */
.tt-pill { position: fixed; right: 12px; bottom: calc(var(--gnav-h, 0px) + 14px + var(--safe-b)); z-index: 40; display: inline-flex; align-items: center; gap: 7px; max-width: calc(100vw - 24px);
  padding: 0 14px 0 12px; height: 42px; border-radius: 21px; border: 0; background: var(--ink); color: var(--bg); font: inherit; font-size: 14px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: bottom .22s ease; }
.tt-pill svg { width: 18px; height: 18px; } .tt-pill b { font-variant-numeric: tabular-nums; }
.tt-pill span { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.tt-pill i { font-style: normal; font-size: 12px; background: var(--blue); color: #fff; border-radius: 10px; padding: 1px 7px; }
body.has-gnav .tt-pill { bottom: calc(var(--gnav-h) + 14px); }
body:has(.sheet-wrap, .viewer, .vplay, .editor, .ring-wrap) .tt-pill { display: none; }
@media (min-width: 700px) { .tl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tl-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tl-actions:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .toolsview { min-height: 100vh; }
  .toolsview .tl-back { display: none; }
  .toolsview .plainbar { padding: 16px 24px 10px; border-bottom: 0; background: var(--bg); position: static; }
  .toolsview .plainbar h1 { font-size: 22px; }
  .toolsview .tl-tabs { justify-content: flex-start; padding: 0 24px; background: var(--bg); }
  .tl-main { padding: 24px; }
  .tl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tl-split { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 24px; }
  .tl-prev { position: sticky; top: 24px; }
  .tt-pill { right: 24px; bottom: 24px; }
}
:root[data-theme="dark"] .tt-pill { background: #E6EAF0; color: #0D1117; }
:root[data-theme="dark"] .tl-canvas canvas { box-shadow: 0 2px 16px rgba(0,0,0,.6); }
/* 1.17.6: alarmas por días de la semana, varias y editables */
.tl-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.tl-days button { height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.tl-days button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
:root[data-theme="dark"] .tl-days button[aria-pressed="true"] { color: #fff; }
#a-sets .chip { min-height: 36px; }
#a-rep { min-height: 18px; margin-top: 2px; }
.tl-time { align-self: flex-start; }
.tl-edb { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.tl-lh { margin: 6px 2px 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tl-lh small { background: var(--blue-soft); color: var(--accent-ink); border-radius: 10px; padding: 0 8px; font-size: 12px; letter-spacing: 0; }
.tl-edit { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tl-edit:hover b { color: var(--accent-ink); }
.tl-row.on { border-color: #F0A35E; box-shadow: 0 0 0 3px rgba(240,140,46,.18); }
.tl-wk { display: flex; gap: 3px; margin-top: 4px; }
.tl-wk i { font-style: normal; font-size: 10.5px; font-weight: 600; width: 22px; height: 18px; border-radius: 5px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.tl-wk i.y { background: var(--blue-soft); color: var(--accent-ink); }
/* 1.17.7: números que no bailan y sonidos por tipo */
i.dg, i.sp { font-style: normal; display: inline-block; text-align: center; }
i.dg { width: .62em; }
i.sp { width: .3em; }
.tl-big { font-variant-numeric: normal; display: flex; align-items: baseline; justify-content: center; white-space: nowrap; }
.tl-big .cs { font-size: .5em; color: var(--muted); font-weight: 600; margin-left: .04em; }
.tt-pill b { white-space: nowrap; }
.tl-seg button span { white-space: nowrap; }
@media (max-width: 380px) { .tl-seg button { font-size: 12px; gap: 4px; } }
.tl-sndbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.tl-sndbar:hover { border-color: var(--accent-ink); }
.tl-sndbar > svg:first-child { color: var(--accent-ink); }
.tl-sndbar span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tl-sndbar b { font-size: 14px; } .tl-sndbar small { color: var(--muted); font-size: 12.5px; }
.tl-sndbar .go { color: var(--muted); }
.tl-sndh { display: flex; align-items: center; gap: 4px; margin: -6px 0 -4px -8px; }
.tl-sk h3 { display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; font-size: 15px; }
.tl-sk h3 svg { color: var(--accent-ink); } .tl-sk h3 small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.tl-sk + .tl-sk { border-top: 1px solid var(--line); padding-top: 12px; }
.tl-sopts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 560px) { .tl-sopts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tl-sop { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); text-align: left; cursor: pointer; }
.tl-sop.on { border-color: var(--accent-ink); background: var(--blue-tint); color: var(--accent-ink); font-weight: 600; }
.tl-sop .radio { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); }
.tl-sop.on .radio { border: 5px solid var(--blue); }
.tl-try { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13.5px; text-decoration: none; }
.tl-try svg { width: 15px; height: 15px; }
/* ---------- 1.17.8: Recordatorios y notas + «Mi día» ---------- */
.rem-wrap { max-width: 720px; }
.rem-top { display: flex; flex-direction: column-reverse; gap: 10px; }
.rem-top > .btn { min-height: 48px; }
@media (min-width: 560px) { .rem-top { flex-direction: row; align-items: center; } .rem-top .seg { flex: 1; min-width: 0; } .rem-top > .btn { min-height: 50px; flex: none; } }
.seg-n { font-style: normal; font-size: 11px; font-weight: 700; background: var(--blue); color: #fff; border-radius: 9px; padding: 0 6px; margin-left: 4px; line-height: 17px; }
.rm-g .tl-lh.g-od { color: var(--bad); } .rm-g .tl-lh.g-od small { background: var(--bad-soft); color: var(--bad); }
.rm-list { display: flex; flex-direction: column; gap: 6px; }
.rm { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: opacity .25s, transform .25s; }
.rm.od { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.rm.nw { border-color: var(--accent-ink); box-shadow: inset 3px 0 0 var(--blue); }
.rm.going { opacity: .35; transform: translateX(10px); }
.rm-ck { width: 26px; height: 26px; flex: none; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.rm-ck:hover { border-color: var(--ok); background: var(--ok-soft); }
.rm-ck svg { width: 15px; height: 15px; }
.rm.dn .rm-ck { background: var(--ok); border-color: var(--ok); }
:root[data-theme="dark"] .rm.dn .rm-ck { color: #0D1117; }
.rm-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.rm-b b { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.rm.dn .rm-b b { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.rm-n { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-m { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.rm-m span { display: inline-flex; align-items: center; gap: 4px; } .rm-m svg { width: 13px; height: 13px; }
.rm-due.td { color: var(--accent-ink); font-weight: 600; } .rm-due.od { color: var(--bad); font-weight: 600; }
.rm-tk { color: var(--accent-ink); font-weight: 600; }
.rm-new { font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--blue); color: #fff; border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 2px; }
/* Editor */
.rem-ed { max-height: 92vh; overflow: auto; gap: 14px; }
.rem-ed h2 { margin-bottom: 0; }
.rem-dt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.rem-dt label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.rem-dt .input:disabled { opacity: .5; }
.rem-tk { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--blue-tint); }
.rem-tk span { flex: 1; min-width: 0; font-size: 14px; } .rem-tk b { color: var(--accent-ink); } .rem-tk > svg { color: var(--accent-ink); }
.rem-tres { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; } .rem-tres:empty { display: none; }
.rem-from { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--blue-tint); font-size: 13.5px; color: var(--ink-2); }
.rem-from svg { color: var(--accent-ink); } .rem-from.ok { background: var(--ok-soft); } .rem-from.ok svg { color: var(--ok); }
.rem-due { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 600; }
.rem-btns { display: flex; flex-direction: column; gap: 8px; }
.rem-btns .btn { width: 100%; }
.btn.danger-t, .btn.danger-t:hover { color: var(--bad); }
.rem-lv { max-height: 92vh; overflow: auto; }
.rem-lvr { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.rem-lvr small { margin-left: 8px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.rem-lvr .seg button { font-size: 12.5px; min-height: 38px; }
/* Aviso del recordatorio */
.ring-note { max-width: 340px; padding: 8px 12px; margin: 4px 0 0 !important; border-radius: 10px; background: var(--surface-2); color: var(--ink-2) !important; font-size: 13.5px; white-space: pre-line; text-align: left; }
.ring-it.rem .ring-ic { background: var(--blue-soft); color: var(--accent-ink); }
.ring-x { margin-top: 6px; font-size: 13px; font-weight: 500; }
/* Mi día */
.hgrid > .myday { grid-column: 1 / -1; }
.myday .rm-list { margin: 4px 0 2px; }
.myday .rm { padding: 8px 10px; }
.md-more { font-size: 13px; margin: 6px 2px 0; text-decoration: none; font-weight: 600; }
.md-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.md-tools a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 18px; background: var(--surface-2); color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500; }
.md-tools a:hover { background: var(--blue-soft); color: var(--accent-ink); }
.md-tools svg { width: 16px; height: 16px; color: var(--accent-ink); }
.homep.md-only { max-width: 760px; }
.homep.md-only .myday { padding: 16px 18px; }
/* 1.17.9: avisos con la app cerrada */
.push-card { align-items: center; }
.push-card > span:not(.pc-b) { display: flex; flex-direction: column; gap: 2px; }
.push-card small { color: var(--muted); font-size: 12.5px; }
.push-card.ok { background: var(--ok-soft); } .push-card.ok > svg { color: var(--ok); }
.pc-b { display: flex; gap: 6px; flex: none; }

/* 1.17.10: volumen de los sonidos */
.tl-vol .seg { max-width: 420px; margin: 6px 0 4px; }
.tl-vol small.hint { display: block; margin-top: 4px; }

/* 1.17.12: campanita de avisos, aviso de la primera vez y «Avisos y sonidos» */
.bellbtn { position: relative; text-decoration: none; }
.bellbtn .bdot, .bellbar .bdot { width: 9px; height: 9px; border-radius: 50%; background: #F59E0B; flex: none; }
.bellbtn .bdot { position: absolute; top: 7px; right: 7px; box-shadow: 0 0 0 2px var(--surface); }
.bellbtn.st-on .bdot, .bellbar.st-on .bdot { background: #22C55E; }
.bellbtn.st-blocked .bdot, .bellbar.st-blocked .bdot { background: #DC2626; }
.bellbtn.st-na .bdot, .bellbar.st-na .bdot { background: var(--line-2); }
.bellbar { display: none; }
@media (min-width: 1024px) {
  .topbar .bellbtn, .tl-bell { display: none; }
  .side .bellbar { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 600;
    text-decoration: none; border: 1px solid var(--line); background: var(--surface-2); }
  .side .bellbar svg { width: 17px; height: 17px; flex: none; }
  .side .bellbar span { flex: 1; min-width: 0; }
  .side .bellbar .go { width: 14px; height: 14px; opacity: .6; }
  .side .bellbar.st-on { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.45); }
  .side .bellbar.st-off { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.5); }
  .side .bellbar.st-blocked { background: rgba(220,38,38,.10); border-color: rgba(220,38,38,.4); }
  .side .bellbar[aria-current="page"], .side .bellbar:hover { filter: brightness(.97); }
}
.tl-bell { margin-left: auto; display: flex; }
@media (min-width: 1024px) { .plainbar .tl-bell { display: none; } }
.plainbar .tl-bell .bellbtn .bdot { box-shadow: 0 0 0 2px var(--surface); }
.gm-grid .gm-bell.st-on small { color: var(--ok); } .gm-grid .gm-bell.st-off small { color: var(--warn); } .gm-grid .gm-bell.st-blocked small { color: var(--bad); }
.push-ask { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, #0A4A80, #1565A8); color: #fff; border-radius: 16px; padding: 14px 16px; }
.push-ask .pa-ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none; }
.push-ask .pa-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.push-ask b { font-size: 15.5px; } .push-ask small { opacity: .92; font-size: 13px; }
.push-ask .pa-b { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.push-ask .btn { min-height: 40px; }
.push-ask .btn:not(.ghost) { background: #fff; color: #0A4A80; }
.push-ask .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.lv-ask:not(:empty) { padding: 10px 12px 2px; }
@media (min-width: 1024px) { .lv-ask { display: none; } }
.md-ask:not(:empty) { margin-bottom: 14px; }
.av-wrap { display: grid; gap: 14px; max-width: 1040px; margin: 0 auto; padding: 14px 12px 40px; }
@media (min-width: 900px) { .av-wrap { grid-template-columns: 1fr 1fr; align-items: start; padding: 22px 20px 40px; } }
.av-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.av-col .cz-card { margin: 0; }
.av-st .push-card { margin: 0; }
.av-dev { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.av-dev:first-child { border-top: 0; }
.av-dev > svg { width: 22px; height: 22px; color: var(--accent-ink); flex: none; }
.av-dev span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.av-dev b { font-size: 14.5px; } .av-dev b small { font-weight: 400; color: var(--muted); } .av-dev span > small { color: var(--muted); font-size: 12.5px; }
.av-help { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.av-snd { border-top: 1px solid var(--line); padding: 10px 0; }
.av-snd:first-of-type { border-top: 0; }
.av-sr { display: flex; align-items: center; gap: 10px; }
.av-si { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.av-si svg { width: 18px; height: 18px; }
.av-sn { flex: 1; min-width: 0; display: flex; flex-direction: column; } .av-sn b { font-size: 15px; } .av-sn small { color: var(--muted); font-size: 12.5px; }
.av-sr .linkbtn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.av-sr .linkbtn svg { width: 14px; height: 14px; }
.av-snd .tl-sopts { margin-top: 10px; }
@media (max-width: 899px) {
  .av-col { display: contents; }
  .av-st { order: 1; } .av-snds { order: 2; } .av-vol { order: 3; } .av-devs { order: 4; } .av-hlp { order: 5; }
}
.av-sr { flex-wrap: wrap; }
.av-sn { flex: 1 1 120px; }

/* 1.17.13: tareas programadas */
.rep-box { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 12px; margin: -4px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.rep-box .label { margin: 4px 0 -4px; }
.rep-n { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
.rep-n .input { width: 64px; min-height: 40px; text-align: center; padding: 0 6px; }
.rep-end { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); max-width: 240px; }
.rep-prev:not(:empty) { display: flex; gap: 10px; align-items: flex-start; background: var(--blue-tint); border: 1px solid var(--blue-soft); color: var(--ink-2); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.rep-prev svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; margin-top: 2px; }
.al-other { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.al-other .input { width: auto; min-height: 40px; } .al-other #re-aon { width: 70px; text-align: center; }
.rm-rep { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); }
.rm-rep svg { width: 13px; height: 13px; }
.rm.rs { align-items: center; }
.rm.rs .rs-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; margin: 0 2px 0 4px; }
.rm.rs .rs-ic svg { width: 18px; height: 18px; }
.rm.rs .tgl-sw { flex: none; margin-right: 8px; }
.rm.rs.ps { opacity: .65; }
.rem-hist { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; }
.rem-hist > div { display: grid; grid-template-columns: 20px 1fr; column-gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.rem-hist > div:first-child { border-top: 0; }
.rem-hist svg { width: 16px; height: 16px; grid-row: span 2; margin-top: 2px; }
.rem-hist .ok svg { color: var(--ok); } .rem-hist .ms svg { color: var(--bad); }
.rem-hist small { color: var(--muted); font-size: 12px; grid-column: 2; }

/* 1.17.16: «Mi día» con vistazo de próximos, notas, alarmas y temporizadores */
.md-peek { display: grid; gap: 12px 20px; margin: 10px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (min-width: 1200px) { .md-peek { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.md-sec h4 { margin: 0 0 4px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.md-sec h4 a { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; text-decoration: none; }
.md-li { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border: 0; background: transparent; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.md-li:hover { background: var(--surface-2); color: var(--ink); }
.md-li svg { width: 16px; height: 16px; color: var(--accent-ink); flex: none; }
.md-li { align-items: flex-start; }
.md-li svg { margin-top: 3px; }
.md-li .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.md-li .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-li .w { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-pill i.dg, .tt-pill i.sp { background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit; }

/* 1.17.17: «+ Recordatorio» de Mi día como botón */
.hbox h3 .md-add { letter-spacing: 0; font-size: 13px; min-height: 36px; padding: 0 14px 0 10px; gap: 6px; }
.hbox h3 .md-add svg { width: 16px; height: 16px; }

/* 1.17.19: ¿De qué te aviso? */
.av-pref { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.av-pref:first-of-type { border-top: 0; }
.av-pref > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.av-pref b { font-size: 14.5px; } .av-pref small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 899px) { .av-what { order: 2; } .av-snds { order: 3; } .av-vol { order: 4; } .av-devs { order: 5; } .av-hlp { order: 6; } }

/* 1.17.24: Radiografía del dispositivo */
.dv-wrap { max-width: 1080px; margin: 0 auto; padding: 14px 12px 40px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 900px) { .dv-wrap { padding: 22px 20px 40px; } }
.dv-wrap .cz-card { margin: 0; }
.dv-head { display: flex; align-items: center; gap: 14px; }
.dv-head h2 { margin: 0; font-size: 19px; } .dv-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.dv-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--blue-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.dv-ic svg { width: 26px; height: 26px; }
.dv-cols { display: grid; gap: 14px; }
@media (min-width: 900px) { .dv-cols { grid-template-columns: 1fr 1fr; align-items: start; } }
.dv-cols .cz-h { display: flex; align-items: center; gap: 8px; } .dv-cols .cz-h svg { width: 18px; height: 18px; color: var(--accent-ink); }
.dv-r { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dv-r:first-of-type { border-top: 0; }
.dv-r span { color: var(--muted); flex: none; }
.dv-r b { text-align: right; font-weight: 600; word-break: break-word; } .dv-r b.mut { color: var(--muted); font-weight: 400; }
.dv-ax { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--warn-soft, #FEF3C7); color: #92400E; font-style: normal; font-size: 12px; font-weight: 700; vertical-align: 1px; cursor: help; }
.dv-ax-h { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.dv-test { margin-top: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.dv-test.run { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; margin: 0; flex: none; }
.dv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.dv-kpis span { display: flex; flex-direction: column; gap: 1px; }
.dv-kpis small { color: var(--muted); font-size: 12px; } .dv-kpis b { font-size: 22px; font-weight: 700; color: var(--ink); }
.dv-kpis em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); }
.dv-kpis em.ok { color: var(--ok); } .dv-kpis em.mid { color: var(--warn); } .dv-kpis em.bad { color: var(--bad); }
.dv-test .hint { display: block; margin-top: 8px; }
.dv-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dv-btns .btn svg { width: 16px; height: 16px; }
.dv-foot .dv-btns { margin-top: 0; }
.pk-res { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; margin-bottom: 10px; }
.pk-it { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; cursor: pointer; color: var(--ink); }
.pk-it:hover { border-color: var(--accent); }
.pk-it b { color: var(--accent-ink); } .pk-it span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pk-it small { grid-column: 2; color: var(--muted); }

/* 1.17.25: tabla de latencia a varios destinos */
.dv-pt { width: 100%; border-collapse: collapse; font-size: 14px; }
.dv-pt th { text-align: right; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 0 0 6px 8px; }
.dv-pt th:first-child, .dv-pt td:first-child { text-align: left; padding-left: 0; }
.dv-pt td { text-align: right; padding: 8px 0 8px 8px; border-top: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.dv-pt td:first-child { font-weight: 600; white-space: normal; }
.dv-pt td small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.dv-pt td.ok { color: var(--ok); } .dv-pt td.mid { color: var(--warn); } .dv-pt td.bad { color: var(--bad); }
.dv-pt td.mut { color: var(--muted); font-weight: 400; } .dv-pt td .spinner { display: inline-block; vertical-align: -3px; margin-right: 4px; }

/* 1.17.27: ¿Qué es normal? */
.dv-i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; color: var(--accent-ink);
  font: italic 700 11px/1 Georgia, serif; cursor: pointer; margin-left: 4px; vertical-align: 1px; padding: 0; }
.dv-i:hover { background: var(--blue-soft); }
.nethelp h3 { margin: 16px 0 6px; font-size: 14px; } .nethelp h3 small { font-weight: 400; color: var(--muted); }
.nh-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.nh-t th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-align: left; padding: 0 6px 4px; }
.nh-t td { padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.nh-t td:first-child { font-weight: 600; padding-left: 0; } .nh-t td small { display: block; font-weight: 400; color: var(--muted); }
.nh-t td.ok { color: var(--ok); font-weight: 600; } .nh-t td.mid { color: var(--warn); font-weight: 600; } .nh-t td.bad { color: var(--bad); font-weight: 600; }
.nh-p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
