@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url('/fonts/manrope-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url('/fonts/manrope-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url('/fonts/manrope-latin-600-normal.woff2') format('woff2'); }
/* Layout: una columna tipo app de teléfono; barra inferior Resumen · Hoy · + · Clientes · Historial; hojas que suben desde abajo.
   Identidad Prisma: grises neutros y el naranja como única fuente de calor. Tema claro (hoja blanca) y oscuro (taller a oscuras). */
:root {
  /* Tema claro (hoja blanca de Prisma) */
  --bg: #F5F4F2;
  --s1: #FFFEFC;
  --s2: #EFEDEA;
  --s3: #E4E1DD;
  --fg: rgba(14, 11, 9, .92);
  --fg2: rgba(14, 11, 9, .66);
  --fg3: rgba(14, 11, 9, .58);
  --line: rgba(14, 11, 9, .08);
  --line2: rgba(14, 11, 9, .15);
  --brand: #FF4201;
  --orange: #C42D00;
  --orange-soft: rgba(255, 66, 1, .10);
  --brand-line: rgba(255, 66, 1, .38);
  --brand-glow: rgba(255, 66, 1, .32);
  --scrim: rgba(10, 10, 10, .55);
  --ok: #127A4C;
  --ok-soft: rgba(18, 122, 76, .10);
  --on-ok: #FFFEFC;
  --dezik: #4B5BD6;
  --cold: #0B6E86;
  --cold-soft: rgba(11, 110, 134, .12);
  --on-fg: #FFFEFC;
  --ink-on-light: #0E0B09;
  --toast-link: #FF8A5B;
  --bar-bg: rgba(255, 254, 252, .9);
  --toast-bg: #1F1B18;
  --shadow: rgba(10, 10, 10, .16);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 16px;
  --ease: cubic-bezier(.25, 1, .5, 1); /* ease-out-quart */
  --sb: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0A09; --s1: #161514; --s2: #211F1D; --s3: #2B2826;
    --fg: rgba(246, 244, 241, .92); --fg2: rgba(246, 244, 241, .64); --fg3: rgba(246, 244, 241, .50);
    --line: rgba(246, 244, 241, .10); --line2: rgba(246, 244, 241, .16);
    --orange: #FF4201; --orange-soft: rgba(255, 66, 1, .14);
    --ok: #3DDC97; --ok-soft: rgba(61, 220, 151, .14); --on-ok: #0A0A0A;
    --dezik: #8C9BFF; --cold: #6FD3EA; --cold-soft: rgba(111, 211, 234, .14); --on-fg: #0A0A0A; --toast-link: #A82700;
    --bar-bg: rgba(11, 10, 9, .88); --toast-bg: #EFEDEA; --shadow: rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"], html:root.theme-dark {
  --bg: #0B0A09; --s1: #161514; --s2: #211F1D; --s3: #2B2826;
  --fg: rgba(246, 244, 241, .92); --fg2: rgba(246, 244, 241, .64); --fg3: rgba(246, 244, 241, .50);
  --line: rgba(246, 244, 241, .10); --line2: rgba(246, 244, 241, .16);
  --orange: #FF4201; --orange-soft: rgba(255, 66, 1, .14);
  --ok: #3DDC97; --ok-soft: rgba(61, 220, 151, .14); --on-ok: #0A0A0A;
  --dezik: #8C9BFF; --cold: #6FD3EA; --cold-soft: rgba(111, 211, 234, .14); --on-fg: #0A0A0A; --toast-link: #A82700;
  --bar-bg: rgba(11, 10, 9, .88); --toast-bg: #EFEDEA; --shadow: rgba(0, 0, 0, .45);
  color-scheme: dark;
}
/* Elección manual en Ajustes: gana sobre el tema del sistema */
html:root.theme-light {
  --bg: #F5F4F2; --s1: #FFFEFC; --s2: #EFEDEA; --s3: #E4E1DD;
  --fg: rgba(14, 11, 9, .92); --fg2: rgba(14, 11, 9, .66); --fg3: rgba(14, 11, 9, .58);
  --line: rgba(14, 11, 9, .08); --line2: rgba(14, 11, 9, .15);
  --orange: #C42D00; --orange-soft: rgba(255, 66, 1, .12);
  --ok: #127A4C; --ok-soft: rgba(18, 122, 76, .10); --on-ok: #FFFEFC;
  --dezik: #4B5BD6; --cold: #0B6E86; --cold-soft: rgba(11, 110, 134, .12); --on-fg: #FFFEFC; --toast-link: #FF8A5B;
  --bar-bg: rgba(255, 254, 252, .9); --toast-bg: #1F1B18; --shadow: rgba(10, 10, 10, .16);
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { font-family: var(--font); background: var(--bg); color: var(--fg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
svg { display: block; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }

.screen { max-width: 640px; margin: 0 auto; padding-block: 12px 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0 14px; }
.topbar > div { min-width: 0; }
.kicker { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--fg2); }
.title { font-size: 32px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; text-wrap: balance; overflow-wrap: anywhere; }
.subtitle { color: var(--fg2); margin-top: 4px; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--s2); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--fg); flex-shrink: 0; border: 1px solid var(--line); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--fg2); padding: 8px 8px 8px 0; margin-left: -4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--fg2); }
.icon-btn:active { background: var(--s2); }
.banner { display: block; background: var(--orange-soft); color: var(--fg); border-radius: 12px; padding: 10px 14px; font-size: 15px; margin-bottom: 14px; width: 100%; text-align: left; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; align-items: center; gap: 4px;
  padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(var(--sb) + 8px) max(10px, env(safe-area-inset-left, 0px));
  background: var(--bar-bg); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; font-size: 12px; font-weight: 500; color: var(--fg3); padding: 4px 6px; position: relative; }
.tab.on { color: var(--fg); }
.tab .dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.tab.on .dot { background: var(--brand); }
.tab .badge { position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--brand); color: var(--ink-on-light); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.fab { width: 54px; height: 54px; border-radius: 50%; background: var(--brand); color: var(--ink-on-light); display: grid; place-items: center; box-shadow: 0 6px 24px var(--brand-glow); margin: -6px 6px 0; flex-shrink: 0; }
.fab:active { transform: scale(.95); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); color: var(--fg2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--fg); color: var(--on-fg); border-color: var(--fg); }
.chip.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.chip .cdot { display: none; }
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.filters > .btn-md { align-self: flex-start; }
.toolbar .search { flex: 1 1 auto; min-width: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--s1); border-radius: 12px; padding: 2px; border: 1px solid var(--line); min-height: 40px; }
.seg button { min-height: 34px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--fg2); padding: 0 12px; }
.seg button.on { background: var(--s3); color: var(--fg); }

.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 0 2px; flex-wrap: wrap; }
.section-title { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--fg2); display: flex; align-items: center; gap: 8px; }
.section-title .count { font-size: 12px; letter-spacing: 0; color: var(--fg3); }
.section.hot .section-title { color: var(--orange); }
.section-hint { font-size: 12px; color: var(--fg3); }
.list { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 60px; width: 100%; text-align: left; cursor: pointer; }
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--s2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.row-meta { font-size: 13px; color: var(--fg2); margin-top: 2px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-meta .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.co-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.date { font-size: 12px; font-weight: 500; color: var(--fg2); white-space: nowrap; }
.date.late { color: var(--orange); }
.date.today { color: var(--fg); }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--s3); font-size: 12px; font-weight: 600; display: grid; place-items: center; color: var(--fg2); }
.mini-avatar.me { background: var(--s3); color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--fg3); flex-shrink: 0; display: grid; place-items: center; color: transparent; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease); }
.check:active { transform: scale(.9); }
.check.on, .row.completing .check { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.row.completing { opacity: .45; transition: opacity .3s ease .2s; }
.row.completing .row-title { text-decoration: line-through; }
/* Hecho: el círculo late una vez y la marca se dibuja */
.row.completing .check { animation: check-pop .32s var(--ease); }
.row.completing .check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: check-draw .26s var(--ease) .06s forwards; }
@keyframes check-pop { 45% { transform: scale(1.14); } }
@keyframes check-draw { to { stroke-dashoffset: 0; } }
details.just-opened > :not(summary) { animation: reveal .24s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .row.completing .check, details.just-opened > :not(summary) { animation: none; }
  .row.completing .check path { animation: none; stroke-dashoffset: 0; }
}
.tag-icon { color: var(--fg2); display: inline-flex; }
.nostep { color: var(--orange); }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.pill-lead { background: var(--s3); color: var(--fg); }
.pill-urgent { background: var(--orange-soft); color: var(--orange); }
.pill-proposal, .pill-negotiation { background: var(--s3); color: var(--fg); }

.pill-active { background: var(--ok-soft); color: var(--ok); }
.pill-finished { background: transparent; color: var(--ok); border: 1px solid var(--ok); }
.pill-react { background: transparent; color: var(--fg); border: 1px solid var(--line2, var(--fg3)); }
.pill-paused { background: var(--s3); color: var(--fg2); }
.pill-lost { background: transparent; color: var(--fg3); border: 1px solid var(--line2); }
.pill-cold { background: var(--cold-soft); color: var(--cold); }
.pill-tag { background: transparent; color: var(--fg2); border: 1px solid var(--line2); font-weight: 500; }

.empty { text-align: center; padding: 34px 20px; color: var(--fg2); }
.empty .btn { margin: 12px auto 0; }
/* Nota corta debajo del título de una sección */
.section-note { margin: -2px 2px 10px; }
.empty strong { display: block; color: var(--fg); font-weight: 500; font-size: 19px; margin-bottom: 4px; }
.allclear { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.allclear strong { display: block; font-weight: 500; font-size: 19px; }
.allclear span { color: var(--fg2); }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.summary.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { background: var(--s1); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-width: 0; }
.stat b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--fg2); display: block; }
.stat small { font-size: 12px; color: var(--fg3); display: block; margin-top: 2px; }
.stat.hot b { color: var(--orange); }
.stat.good b { color: var(--ok); }

/* Barras: una sola serie por gráfico, un solo tono */
.bars { display: flex; flex-direction: column; gap: 10px; }
/* Estadísticas: dos grupos grandes (Ahora / En el período) y subsecciones dentro */
.stat-group { margin-top: 28px; }
.stat-group + .stat-group { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 12px; }
.group-title { font-size: 24px; font-weight: 500; letter-spacing: -.015em; line-height: 1.15; }
.group-hint { font-size: 13px; color: var(--fg2); }
.stat-group > .seg { width: 100%; grid-auto-columns: auto; }
.stat-group > .seg button { white-space: nowrap; padding: 0 8px; }
.stat-range { margin: 8px 2px 4px; }
.stat-sub { margin-top: 26px; }
.stat-sub > .section-title { margin: 0 2px 10px; }
.stat-note { margin: 0 2px 10px; }
.stat-empty { margin: 26px 2px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.stat-group .big-line { margin: 0 2px 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-label { color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--s2); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-fill { height: 100%; background: var(--fg2); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-fill.zero { min-width: 0; }
.bar-val { color: var(--fg); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar-val small { color: var(--fg3); margin-left: 6px; }
.progress { height: 6px; background: var(--s2); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th { text-align: right; font-weight: 500; color: var(--fg3); padding: 0 0 8px 10px; white-space: nowrap; font-size: 12px; }
table.data th:first-child, table.data td:first-child { text-align: left; padding-left: 0; }
table.data td { text-align: right; padding: 9px 0 9px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
table.data td:first-child { color: var(--fg); white-space: normal; }
table.data td.dim { color: var(--fg3); }

/* Tablero: una columna por etapa, se arrastra manteniendo presionado */
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; align-items: stretch; }
.board.dragging-on { scroll-snap-type: none; }
.kcol { flex: 0 0 min(78%, 268px); scroll-snap-align: start; background: transparent; border: 1px dashed transparent; border-radius: var(--r); display: flex; flex-direction: column; transition: border-color .15s ease, background .15s ease; }
.board.dragging-on .kcol { border-color: var(--line); }
.kcol.over { border-color: var(--brand); border-style: solid; background: var(--s2); }
.kcol-head { padding: 12px 12px 8px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.kcol-head b { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--fg2); }
.kcol-head span { font-size: 12px; color: var(--fg3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; min-height: 84px; }
.kcard { background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: grab; text-align: left; width: 100%;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .12s ease, opacity .12s ease; }
.kcard.lifting { transform: scale(.97); }
.kcard.placeholder { opacity: .25; }
.kcard.ghost { position: fixed; z-index: 70; pointer-events: none; box-shadow: 0 14px 34px var(--shadow); transform: rotate(2deg); margin: 0; border-color: var(--brand); }
.k-title { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.k-meta { font-size: 12px; color: var(--fg2); margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.k-meta .amount { font-size: 12px; }
.kempty { font-size: 12px; color: var(--fg3); text-align: center; padding: 18px 8px; border: 1px dashed var(--line2); border-radius: 12px; }

.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; color: var(--fg3); min-width: 0; }
.search input { flex: 1; background: transparent; border: 0; outline: 0; font-size: 16px; color: var(--fg); min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span, .label { font-size: 13px; font-weight: 500; color: var(--fg2); }
.input, .textarea { width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--fg); outline: none; }
.input { min-height: 48px; }
.input:focus, .textarea:focus { border-color: var(--fg2); }
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--fg3); }
.hint { font-size: 12px; color: var(--fg3); }
.err { color: var(--orange); font-size: 13px; min-height: 18px; }
.btn { min-height: 48px; padding: 0 20px; border-radius: 12px; font-weight: 600; font-size: 15px; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; }
.btn-primary { background: var(--brand); color: var(--ink-on-light); }
.btn-ghost { background: var(--s2); color: var(--fg); }
.btn-danger { background: transparent; color: var(--orange); border: 1px solid var(--brand-line); }
.btn-block { width: 100%; }
.btn-md { min-height: 40px; padding: 0 14px; font-size: 13px; border-radius: 10px; gap: 6px; white-space: nowrap; flex-shrink: 0; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; white-space: nowrap; }
.btn-icon { width: 40px; padding: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > * { flex: 1; }
.link-btn { color: var(--fg); font-weight: 600; font-size: 13px; min-height: 32px; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.link-u { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--fg3); text-align: left; }
.fact-link { width: 100%; text-align: left; cursor: pointer; }
.fact-link b::after { content: '›'; color: var(--fg3); font-weight: 400; margin-left: 8px; }
.fact-link:active { background: var(--s2); }

.client-head { padding: 4px 0 14px; }
.client-head .title { font-size: 32px; }
.client-meta { margin-top: 10px; color: var(--fg2); line-height: 1.6; }
.client-meta .mi:not(:last-child)::after { content: '·'; color: var(--fg3); margin: 0 8px; }
.client-meta .mini-avatar { display: inline-grid; vertical-align: -6px; margin-right: 6px; }
.client-head .title.long { font-size: 24px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sel-ic { display: none; }
@media (max-width: 359px) {
  .tab { min-width: 0; padding: 4px 3px; }
  .fab { margin-inline: 2px; }
  .sel-ic { display: inline-flex; }
  .sel-lbl { display: none; }
  [data-act=startSelect], [data-act=endSelect] { padding: 0 11px; }
}
.amount { font-size: 15px; color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.composer .textarea { min-height: 40px; height: 40px; padding: 8px 12px; background: var(--s1); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 12px 2px; }
.tl-item + .tl-item { border-top: 1px solid var(--line); }
.tl-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--s2); display: grid; place-items: center; color: var(--fg2); flex-shrink: 0; }
.tl-icon.ok { background: var(--ok-soft); color: var(--ok); }
.tl-body { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-meta { font-size: 12px; color: var(--fg3); margin-top: 2px; }
.tl-del { color: var(--fg3); font-size: 12px; padding: 2px 4px; align-self: flex-start; white-space: nowrap; }
.day-head { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--fg3); margin: 18px 2px 8px; }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.card p { color: var(--fg2); font-size: 13px; }
.card p + p { margin-top: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.me-card { display: flex; align-items: center; gap: 14px; }
.me-card .avatar-btn { width: 52px; height: 52px; font-size: 19px; }
.person { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.person + .person { border-top: 1px solid var(--line); }
.person-top { display: flex; align-items: center; gap: 12px; }

.cl-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; width: 100%; text-align: left; }
.cl-item + .cl-item { border-top: 1px solid var(--line); }
.cl-item .check { width: 22px; height: 22px; }
.cl-item.done span { color: var(--fg3); text-decoration: line-through; }
.cl-add { display: flex; gap: 8px; margin-top: 10px; }
.cl-add .input { padding: 9px 12px; font-size: 15px; }

.center { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; max-width: 440px; margin: 0 auto; }
.center h1 { font-size: 32px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 10px; text-wrap: balance; }
.center h1 em { font-style: normal; color: var(--orange); }
.center .lead { color: var(--fg2); margin-bottom: 24px; }
.wordmark { font-size: 15px; font-weight: 500; letter-spacing: -.01em; margin-bottom: 32px; color: var(--fg2); }
.wordmark em { font-style: normal; color: var(--orange); }

.backdrop { position: fixed; inset: 0; z-index: 50; background: var(--scrim); opacity: 0; transition: opacity .2s ease; }
.backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 640px; margin: 0 auto; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px);
  background: var(--s1); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet.show { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 4px max(20px, env(safe-area-inset-left, 0px)); }
.sheet-head h2 { font-size: 19px; font-weight: 500; }
.sheet-grip { width: 38px; height: 5px; border-radius: 4px; background: var(--s3); margin: 8px auto 0; }
.sheet-body { overflow-y: auto; padding: 10px max(20px, env(safe-area-inset-right, 0px)) calc(var(--sb) + 20px) max(20px, env(safe-area-inset-left, 0px)); -webkit-overflow-scrolling: touch; }
.picker-list { margin-top: 8px; background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.picker-list .row { min-height: 50px; padding: 10px 14px; }
.selected-client { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 10px 10px 14px; }
.newclient { border: 1px dashed var(--line2); border-radius: 16px; padding: 16px 14px 0; margin-bottom: 16px; }
.newclient .label-top { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--fg2); margin-bottom: 12px; }
.datechip { position: relative; }
.datechip input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

#toast { position: fixed; left: 50%; bottom: calc(var(--sb) + 92px); z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--toast-bg); color: var(--on-fg); border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 15px;
  width: max-content; max-width: calc(100vw - 32px); transition: opacity .2s var(--ease), transform .25s var(--ease); box-shadow: 0 10px 30px var(--shadow); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: var(--toast-link); font-weight: 600; padding: 6px 8px; border-radius: 8px; font-size: 15px; white-space: nowrap; flex-shrink: 0; }
#toast .t-msg { padding-right: 6px; min-width: 0; flex: 1 1 auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Área táctil mínima de 44 px: el elemento se ve igual, pero el toque se extiende */
.check, .chip, .link-btn, .tl-del, .avatar-btn, .icon-btn, .btn-sm, .back, .seg button, .cl-item .check { position: relative; }
.check::after, .chip::after, .link-btn::after, .tl-del::after, .avatar-btn::after, .icon-btn::after, .btn-sm::after, .back::after, .seg button::after {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: max(100%, 44px); transform: translateY(-50%);
}
.check::after, .avatar-btn::after, .icon-btn::after { left: 50%; width: max(100%, 44px); transform: translate(-50%, -50%); }
.datechip::after { display: none; }
.chip-add { color: var(--fg); border-style: dashed; }

/* ---------- Piezas de la revisión de UX ---------- */
p, .hint, .row-meta, .tl-body { text-wrap: pretty; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Filas: el texto es un botón y las acciones son botones aparte (sin botones anidados) */
.row-hit { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 2px;
  text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; min-height: 44px; }
.row-hit .row-title, .row-hit .row-meta { display: flex; }
.row-hit .row-title { display: block; }
.row-meta.wrap { flex-wrap: wrap; row-gap: 4px; }
.lead-icon { width: 26px; display: inline-flex; justify-content: center; color: var(--fg2); flex-shrink: 0; }
/* Datos en lista, sin tarjetas */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; border-top: 1px solid var(--line); }
.fact { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.fact span { color: var(--fg2); font-size: 13px; min-width: 0; }
.fact b { font-weight: 500; font-size: 19px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fact.hot b { color: var(--orange); }
.fact.good b { color: var(--ok); }
.fact.cold b { color: var(--cold); }
.big-line { color: var(--fg2); margin: 0 2px 14px; }
.big-line b { color: var(--fg); font-weight: 500; font-size: 24px; letter-spacing: -.015em; margin-right: 6px; }
.calm { color: var(--fg2); margin: 4px 2px 0; }
/* Secciones plegables */
.disclosure { margin-top: 24px; border-top: 1px solid var(--line); }
.disclosure > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 2px; font-weight: 500; }
.disclosure > summary::-webkit-details-marker, .more > summary::-webkit-details-marker { display: none; }
.disclosure > summary .count { color: var(--fg2); font-weight: 400; margin-left: 6px; }
.disclosure > summary .chev, .stage-row .chev { color: var(--fg3); transition: transform .2s var(--ease); }
.disclosure[open] > summary .chev { transform: rotate(90deg); }
.disclosure > .section:first-of-type { margin-top: 6px; }
.disclosure.rules { margin-top: 28px; border-bottom: 1px solid var(--line); }
.disclosure.rules[open] { padding-bottom: 16px; }
.rules-sum { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; min-width: 0; }
.rules-sum .hint { font-weight: 400; }
.none { color: var(--fg3); font-weight: 400; font-size: 13px; letter-spacing: 0; }
.more { margin: 2px 0 14px; }
.more > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 10px 0; font-weight: 600; font-size: 13px; }
.more[open] > summary { margin-bottom: 8px; }
/* Clientes: barra de búsqueda y filtros */
.toolbar { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.toolbar .seg { flex: 0 1 auto; }
.toolbar .spacer { flex: 1; }
.toolbar .search { flex: 1; }
.filter-panel { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 14px; }
.filter-panel .label { margin-top: 4px; }
/* Etapa del cliente: una fila que abre el selector */
.stage-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 12px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.stage-row .hint { flex: 1; min-width: 0; }
/* Guardar siempre a mano en las hojas largas */
.sheet-actions { position: sticky; bottom: calc(-1 * (var(--sb) + 20px)); margin: 8px -20px calc(-1 * (var(--sb) + 20px)); padding: 10px 20px calc(var(--sb) + 16px);
  background: var(--s1); border-top: 1px solid var(--line); z-index: 2; }
.sheet-actions .err:empty { display: none; }
.sheet-actions .err { margin-bottom: 8px; }
[aria-invalid="true"] { border-color: var(--orange) !important; }
/* Carga: siluetas en vez de texto */
.skel { background: var(--s2); border-radius: 8px; position: relative; overflow: hidden; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--line), transparent); animation: skel 1.2s var(--ease) infinite; }
@keyframes skel { to { transform: translateX(100%); } }
.skel-screen { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }
/* En pantallas anchas el tablero usa más espacio */
@media (min-width: 900px) { .screen.wide { max-width: 1180px; } }
/* Teléfono de lado: la barra de abajo se achica para dejar lugar al contenido */
@media (max-height: 500px) and (orientation: landscape) {
  .tabbar { padding-top: 4px; padding-bottom: calc(var(--sb) + 4px); }
  .tab { flex-direction: row; gap: 6px; width: auto; padding: 8px 10px; min-height: 44px; }
  .tab .dot { display: none; }
  .tab.on { color: var(--fg); box-shadow: inset 0 -2px 0 var(--brand); }
  .tab .badge { top: 4px; left: 18px; margin-left: 0; }
  .fab { width: 44px; height: 44px; margin: 0 6px; }
  #toast { bottom: calc(var(--sb) + 64px); }
  .swipe-hint { display: none; }
  .bulkbar { bottom: calc(var(--sb) + 60px); }
}
.me-name { font-size: 15px; font-weight: 500; margin: 0; }

/* Las filas de chips que se desplazan recortan lo que sobresale: dejamos espacio para el área táctil sin mover el diseño */
.chips:not(.wrap) { padding-block: 7px; margin-block: -7px; }

/* ---------- Selección múltiple ---------- */
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px 2px 0; min-height: 44px; }
.list-tools .hint { min-width: 0; }
.pick { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--fg3); flex-shrink: 0; display: grid; place-items: center; color: transparent; position: relative;
  transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.pick::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.pick.on { background: var(--fg); border-color: var(--fg); color: var(--on-fg); }
.row.picked { background: var(--s2); }
.bulkbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb) + 84px); z-index: 30; width: min(608px, calc(100% - 24px));
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; background: var(--s1); border: 1px solid var(--line2); border-radius: 16px;
  box-shadow: 0 12px 32px var(--shadow); }
.bulkbar .bulk-count { flex: 1; min-width: 0; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bulkbar .btn[disabled] { opacity: .4; }

/* ---------- Deslizar filas ---------- */
.row[data-swipe] { position: relative; overflow: hidden; touch-action: pan-y; }
.row.swiping > :not(.swipe-bg) { transform: translateX(var(--dx, 0)); }
.row.settling > :not(.swipe-bg) { transition: transform .2s var(--ease); }
.swipe-bg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 16px; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; pointer-events: none; }
.row.swipe-right .swipe-bg { left: 0; justify-content: flex-start; background: var(--ok-soft); color: var(--ok); }
.row.swipe-left .swipe-bg { right: 0; justify-content: flex-end; background: var(--s3); color: var(--fg); }
.row.armed.swipe-right .swipe-bg { background: var(--ok); color: var(--on-ok); }
.row.armed.swipe-left .swipe-bg { background: var(--fg); color: var(--on-fg); }
@media (prefers-reduced-motion: reduce) { .row.settling > :not(.swipe-bg) { transition: none; } }

/* ---------- Listas largas por partes ---------- */
.more-row { justify-content: center; min-height: 48px; font-weight: 600; font-size: 13px; color: var(--fg); }
.kmore { display: block; width: 100%; min-height: 44px; border: 1px dashed var(--line2); border-radius: 12px; font-weight: 600; font-size: 13px; color: var(--fg2); background: none; }

/* ---------- Atajos ---------- */
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin-top: 10px; font-size: 13px; color: var(--fg2); }
.keys kbd { font: 600 12px/1 var(--font); color: var(--fg); background: var(--s2); border: 1px solid var(--line2); border-radius: 8px; padding: 5px 7px; min-width: 26px; text-align: center; }

/* Barras de desplazamiento con los colores de la app (sin la barra oscura del sistema) */
.board, .table-wrap { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.board::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { height: 6px; }
.board::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: transparent; }
.board::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }
.board::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover { background: var(--fg3); }

/* Empresa como texto (antes era un punto de color sin explicación) */
.co-tag { font-size: 12px; font-weight: 600; color: var(--fg2); flex-shrink: 0; }
.co-tag::after { content: '·'; margin-left: 6px; font-weight: 400; }
.card-title { font-size: 15px; font-weight: 500; margin: 0; }

/* Con la barra de acciones abierta, la última fila no queda tapada */
body.selecting .screen { padding-bottom: 200px; }
body.selecting .fab { visibility: hidden; }
.btn-sm.btn-icon { width: 32px; }
/* audit: área táctil también en botones medianos, búsqueda e ítems de listas */
.btn-md, .search { position: relative; }
.btn-md::after, .search::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
.search input { position: relative; z-index: 1; }
.cl-item { min-height: 44px; }
.search input { align-self: stretch; height: 100%; }
.chips .chip { z-index: 1; }

/* Aviso sin conexión */
.offline-bar { position: fixed; z-index: 60; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 8px); max-width: 560px; margin: 0 auto; padding: 10px 14px; border-radius: 12px; background: var(--toast-bg); color: var(--on-fg); font-size: 13px; font-weight: 500; box-shadow: 0 6px 24px var(--shadow); }

/* Aviso de cliente parecido */
.dup-warn { margin: -6px 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--s2); font-size: 13px; }
.dup-warn strong { display: block; font-weight: 600; margin-bottom: 4px; }
.dup-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; width: 100%; min-height: 40px; align-items: center; text-align: left; border-top: 1px solid var(--line); font-size: 15px; color: var(--fg); }
.dup-row:first-of-type { border-top: 0; }
.dup-row > span:first-child { flex: 1 1 auto; }
.dup-open { font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Glosario */
.hint-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--fg2); min-height: 32px; position: relative; }
.hint-btn::after { content: ''; position: absolute; inset: -6px -4px; }
.hint-btn svg { color: var(--fg3); }
.filter-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.gl-title { margin: 20px 2px 6px; }
.gl-title:first-child { margin-top: 2px; }
.gl-row { display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: start; padding: 10px 2px; border-top: 1px solid var(--line); }
.gl-title + .gl-row { border-top: 0; }
.gl-row p { font-size: 13px; color: var(--fg2); line-height: 1.45; }
.gl-sample { display: flex; align-items: center; min-height: 24px; }
.gl-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--s2); color: var(--fg2); }

/* Tutorial */
.tour-demo { background: var(--s2); border-radius: 16px; padding: 18px 14px; min-height: 132px; display: flex; flex-direction: column; justify-content: center; }
.tour-row { display: flex; align-items: center; gap: 12px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tour-row .row-main { flex: 1 1 auto; min-width: 0; }
.tour-fab { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tour-fab .fab { margin: 0; }
.tour-swipe { position: relative; }
.tour-swipe-bg { position: absolute; inset: 0; border-radius: 12px; background: var(--ok); color: var(--on-ok); display: flex; align-items: center; gap: 6px; padding: 0 14px; font-weight: 600; font-size: 13px; }
.tour-swipe .tour-row { position: relative; transform: translateX(84px); }
@media (prefers-reduced-motion: no-preference) {
  .tour-swipe .tour-row { animation: tour-swipe 2.4s var(--ease) .4s infinite; transform: none; }
  @keyframes tour-swipe { 0%, 15% { transform: none; } 45%, 75% { transform: translateX(84px); } 100% { transform: none; } }
}
.tour-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tour-arrow { color: var(--fg3); display: inline-flex; }
.tour-bubble { align-self: flex-end; max-width: 88%; background: var(--s1); border: 1px solid var(--line); border-radius: 14px 14px 4px 14px; padding: 10px 12px; font-size: 15px; line-height: 1.4; }
.tour-head { font-size: 24px; font-weight: 500; letter-spacing: -.015em; line-height: 1.15; margin: 20px 2px 8px; }
.tour-text { color: var(--fg2); margin: 0 2px; line-height: 1.5; min-height: 4.5em; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin: 18px 0 14px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line2); }
.tour-dots i.on { background: var(--fg); width: 18px; border-radius: 3px; }
.tour-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* Solo en la app instalada: respeta la barra de estado y la muesca del iPhone */
body { padding-top: env(safe-area-inset-top, 0px); }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg2); margin-top: 10px; }
.status-line .sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg3); }
.status-line.on .sdot { background: var(--ok); }
