/* Portal transaccional — henkia.com identity (tokens shared with docs/guia-estudio and antes-despues.html). */
:root {
  --primary: #112F24; --dark: #00170C; --secondary: #0AB07A; --tertiary: #00BD52; --cyan: #B5FDFF;
  --light: #F4F7F6; --grey: #666666; --line: #DEE2E6; --alert: #F2545B; --white: #fff;
  --warn-bg: #FFF3D6; --warn-fg: #7A5300; --err-bg: #FDE7E8; --err-fg: #A3242B; --ok-fg: #05774F;
  --head: 'Darker Grotesque', sans-serif; --body: Sora, sans-serif;
  --radius: 22px; --shadow: 0 8px 28px rgba(0, 23, 13, .1); --chat-w: 380px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 110px; }
body { margin: 0; background: var(--light); color: var(--primary); font-family: var(--body); font-weight: 300; line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--primary); text-decoration-color: var(--secondary); text-underline-offset: 3px; }
a:hover { color: var(--secondary); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: var(--light); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--dark); color: var(--white); padding: 10px 18px; border-radius: 100px; font-family: var(--head); font-weight: 700; }
.skip:focus { top: 12px; color: var(--cyan); }
.muted { color: var(--grey); }
.small { font-size: 13px; line-height: 20px; }
.note { font-size: 12px; color: var(--grey); margin: 10px 0 0; min-height: 1em; }
.loading { padding: 80px 0; color: var(--grey); }

/* ---- header ---- */
header.site { position: sticky; top: 16px; z-index: 30; max-width: 1440px; margin: 16px auto 0; padding: 0 16px; }
header.site .pill { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 100px; box-shadow: var(--shadow); padding: 12px 14px 12px 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { height: 20px; width: auto; display: block; }
.brand .product { font-family: var(--head); font-weight: 700; font-size: 17px; color: var(--grey); white-space: nowrap; border-left: 1px solid var(--line); padding-left: 12px; }
.tabs { display: flex; gap: 4px; background: var(--light); border-radius: 100px; padding: 4px; margin: 0; list-style: none; }
.tab { display: block; white-space: nowrap; font-family: var(--head); font-weight: 700; font-size: 16px; color: var(--primary); padding: 7px 16px; border-radius: 100px; text-decoration: none; }
.tab:hover { color: var(--secondary); }
.tab.on { background: var(--dark); color: var(--white); }
.tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.select { font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--primary); background: var(--white); border: 0; box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 100px; padding: 8px 14px; max-width: 280px; min-width: 0; }
.select.small { padding: 6px 12px; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 700; font-size: 14px; background: var(--dark); color: var(--white);
  border-radius: 100px; padding: 7px 14px; white-space: nowrap; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); }
.badge .dot.on { background: var(--tertiary); }
.badge .dot.off { background: var(--cyan); }

/* ---- layout ---- */
.layout { max-width: 1440px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr) var(--chat-w); gap: 24px; align-items: start; }
main { min-width: 0; padding-bottom: 72px; }
main:focus { outline: none; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
.site-foot { background: var(--dark); color: rgba(255, 255, 255, .72); padding: 36px 0; font-size: 13px; }

/* ---- hero ---- */
.hero { padding: 56px 0 24px; }
.hero.compact { padding-top: 48px; }
.eyebrow { font-size: 14px; color: var(--grey); margin: 0 0 10px; }
.hero h1 { font-family: var(--head); font-weight: 300; font-size: 64px; line-height: 58px; letter-spacing: -1px; margin: 0; max-width: 18ch; overflow-wrap: anywhere; }
.lead { font-size: 18px; line-height: 29px; color: var(--grey); max-width: 62ch; margin: 18px 0 0; }
.title-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 24px 0 0; }
.progress { flex: 1; min-width: 120px; height: 6px; background: var(--line); border-radius: 100px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--secondary); transition: width .4s; }
.counter { font-size: 13px; color: var(--grey); white-space: nowrap; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 700; font-size: 16px; line-height: 1.2; color: var(--white); background: var(--dark);
  border: 0; border-radius: 100px; padding: 11px 22px; cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--cyan); }
.btn.ghost { background: var(--white); color: var(--dark); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { color: var(--secondary); }
.btn.small { font-size: 15px; padding: 8px 16px; }
.btn:disabled { opacity: .45; cursor: default; color: var(--white); }
.btn.ghost:disabled { color: var(--dark); }
.btn-ic { display: inline-flex; }
.icon-btn { border: 0; background: var(--light); color: var(--dark); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.chip-btn { font-family: var(--body); font-size: 12px; font-weight: 400; color: var(--primary); background: var(--white); border: 0; box-shadow: inset 0 0 0 1px var(--secondary);
  border-radius: 100px; padding: 6px 12px; cursor: pointer; text-align: left; }
.chip-btn:hover { background: var(--cyan); }

/* ---- cards ---- */
.card { background: var(--white); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card.dark { background: var(--dark); color: var(--white); }
.card h3, .h3 { font-family: var(--head); font-weight: 700; font-size: 22px; line-height: 1.2; margin: 0 0 12px; }
.h4 { font-family: var(--head); font-weight: 700; font-size: 18px; margin: 18px 0 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.grid-1-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px; margin-top: 20px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.alert-card { margin-top: 48px; border-left: 6px solid var(--alert); }

/* ---- KPIs ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--white); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 2px; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--grey); }
.kpi strong { font-family: var(--head); font-weight: 700; font-size: 44px; line-height: 1.05; color: var(--dark); overflow-wrap: anywhere; }
.kpi small { font-size: 12px; color: var(--grey); line-height: 18px; }
.kpi.good { background: var(--dark); }
.kpi.good strong { color: var(--cyan); }
.kpi.good .kpi-label, .kpi.good small { color: rgba(255, 255, 255, .75); }
.kpi.attn { background: var(--cyan); }
.kpi.attn .kpi-label, .kpi.attn small { color: var(--primary); }

/* ---- bars ---- */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-label { overflow-wrap: anywhere; font-weight: 400; }
.bar-track { height: 10px; background: var(--light); border-radius: 100px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--secondary), var(--tertiary)); border-radius: 100px; }
.bar-value { color: var(--grey); white-space: nowrap; font-size: 12px; }

/* ---- alerts & lots ---- */
.alerts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.alerts li { display: flex; gap: 10px; align-items: flex-start; }
.pip { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--secondary); }
.alerts .warn .pip { background: #E0A100; }
.alerts .error .pip { background: var(--alert); }
.alerts .human .pip { background: var(--dark); box-shadow: 0 0 0 3px var(--cyan); }
.lots { list-style: none; margin: 0; padding: 0; }
.lots li + li { border-top: 1px solid var(--line); }
.lot { display: grid; grid-template-columns: 48px minmax(0, 1.4fr) auto minmax(0, 1fr) 70px; gap: 12px; align-items: center; padding: 10px 6px; text-decoration: none; font-size: 13px; border-radius: 12px; }
.lots li.current .lot { background: var(--light); }
.lot-id { font-family: var(--head); font-weight: 700; font-size: 18px; }
.lot-name b { font-weight: 400; display: block; }
.lot-name small, .lot-when, .lot-dur { color: var(--grey); }
.lot-dur { text-align: right; }
.status { font-family: var(--head); font-weight: 700; font-size: 13px; padding: 3px 11px; border-radius: 100px; white-space: nowrap; background: var(--light); color: var(--primary); }
.status.done { background: #DDF6EC; color: var(--ok-fg); }
.status.running { background: var(--cyan); color: var(--dark); }
.status.replay { background: var(--dark); color: var(--cyan); }
.status.error { background: var(--err-bg); color: var(--err-fg); }
.status.attn { background: var(--cyan); color: var(--dark); }

/* ---- new run form ---- */
.new-run { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--white); border-radius: 100px; padding: 8px 8px 8px 20px; box-shadow: var(--shadow); }
.new-run[hidden] { display: none; }
.new-run label { font-size: 13px; color: var(--grey); }
.form-msg { font-size: 13px; color: var(--grey); margin: 6px 0 0; }
.form-msg:empty { display: none; }

/* ---- pipeline strip ---- */
.strip-card { padding: 18px; }
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pstep-in { display: grid; grid-template-areas: "n status" "name name" "result result" "dur dur"; grid-template-columns: auto 1fr; gap: 2px 8px; height: 100%;
  padding: 14px; border-radius: 16px; background: var(--light); text-decoration: none; color: inherit;
  transition: background .45s, box-shadow .45s, opacity .45s, transform .45s; }
.pstep .step-n { grid-area: n; font-family: var(--head); font-weight: 700; font-size: 14px; color: var(--grey); }
.pstep .step-status { grid-area: status; justify-self: end; font-family: var(--head); font-weight: 700; font-size: 12px; padding: 1px 9px; border-radius: 100px; background: var(--white); white-space: nowrap; }
.pstep .step-name { grid-area: name; font-family: var(--head); font-weight: 700; font-size: 19px; line-height: 1.1; margin-top: 6px; color: var(--dark); }
.pstep .step-result { grid-area: result; font-size: 12px; line-height: 17px; color: var(--grey); overflow-wrap: anywhere; }
.pstep .step-dur { grid-area: dur; font-size: 12px; font-weight: 400; color: var(--primary); }
.pstep.idle .pstep-in { opacity: .45; }
.pstep.skipped .pstep-in { opacity: .45; background: repeating-linear-gradient(135deg, var(--light) 0 8px, #EDF1EF 8px 16px); }
.pstep.running .pstep-in { background: var(--cyan); box-shadow: 0 14px 34px rgba(0, 23, 13, .14); transform: translateY(-2px); }
.pstep.running .step-status { background: var(--dark); color: var(--cyan); animation: pulse 1.2s ease-in-out infinite; }
.pstep.done .pstep-in { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.pstep.done .step-status { background: #DDF6EC; color: var(--ok-fg); }
.pstep.error .pstep-in { background: var(--err-bg); }
.pstep.error .step-status { background: var(--alert); color: var(--white); }
.pstep.waiting .pstep-in { background: var(--dark); }
.pstep.waiting .step-name { color: var(--white); }
.pstep.waiting .step-result, .pstep.waiting .step-n { color: rgba(255, 255, 255, .78); }
.pstep.waiting .step-status { background: var(--cyan); color: var(--dark); }
a.pstep-in:hover .step-name { color: var(--cyan); }
@keyframes pulse { 50% { opacity: .55; } }

/* ---- timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ev { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); animation: rise .45s ease-out; }
.ev:first-child { border-top: 0; }
.ev.empty { display: block; color: var(--grey); font-size: 14px; }
.ev-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--light); color: var(--primary); }
.ev.done .ev-ic { background: #DDF6EC; color: var(--ok-fg); }
.ev.warn .ev-ic { background: var(--warn-bg); color: var(--warn-fg); }
.ev.error .ev-ic { background: var(--err-bg); color: var(--err-fg); }
.ev.human .ev-ic { background: var(--dark); color: var(--cyan); }
.ev-text { margin: 0; font-size: 14px; line-height: 20px; font-weight: 400; overflow-wrap: anywhere; }
.ev-meta { margin: 2px 0 0; font-size: 12px; color: var(--grey); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- search & record ---- */
.search label { display: block; font-size: 13px; color: var(--grey); margin-bottom: 6px; }
.search-row { display: flex; gap: 8px; }
.search-wide { margin-top: 22px; max-width: 520px; }
.input { font-family: var(--body); font-weight: 400; font-size: 14px; color: var(--primary); background: var(--white); border: 0; box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 14px; padding: 10px 14px; width: 100%; min-width: 0; }
.search .input { border-radius: 100px; padding: 10px 18px; }
textarea.input { resize: vertical; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fact { background: var(--white); border-radius: var(--radius); padding: 18px 22px; min-width: 0; }
.fact span { display: block; font-size: 13px; color: var(--grey); }
.fact small, .fact a { display: block; margin-top: 4px; }
.fact strong { font-family: var(--head); font-weight: 700; font-size: 24px; line-height: 1.15; color: var(--dark); overflow-wrap: anywhere; }
.why { background: var(--dark); color: var(--white); }
.why-text { font-size: 17px; line-height: 28px; margin: 0; }

/* ---- comparación ---- */
.cols { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cols li { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--light); }
.col-name { font-family: var(--head); font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.meter { height: 8px; background: var(--white); border-radius: 100px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--secondary); }
.cols li.off .meter i { background: #E0A100; }
.col-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--grey); }
.col-stats b { color: var(--primary); font-weight: 400; }
.labels { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.labels li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; }
.labels small { grid-column: 1 / -1; color: var(--grey); font-size: 12px; line-height: 18px; }
.labels b { font-family: var(--head); font-weight: 700; font-size: 22px; }
.chip { display: inline-block; font-family: var(--head); font-weight: 700; font-size: 13px; padding: 2px 11px; border-radius: 100px; background: var(--light); }
.label-nuestro { background: var(--err-bg); color: var(--err-fg); }
.label-macro { background: var(--warn-bg); color: var(--warn-fg); }
.label-negocio { background: var(--dark); color: var(--cyan); }
.label-datos { background: var(--white); color: var(--primary); box-shadow: inset 0 0 0 1px var(--secondary); }
.subcard { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--line); }
.doc { margin-top: 20px; }
.md { font-size: 14px; line-height: 22px; }
.md .md-h { font-family: var(--head); font-weight: 700; font-size: 20px; margin: 22px 0 8px; }
.md h3.md-h { font-size: 28px; font-weight: 300; }
.md ul { padding-left: 20px; }
.md li::marker { color: var(--secondary); }
.table-wrap { overflow-x: auto; max-width: 100%; margin: 8px 0 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-family: var(--head); font-weight: 700; font-size: 14px; background: var(--light); }
tr:last-child td { border-bottom: 0; }

/* ---- bandeja ---- */
.rerun { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.rerun p { margin: 0; color: rgba(255, 255, 255, .78); }
.rerun .btn { background: var(--cyan); color: var(--dark); }
.rerun .form-msg { color: rgba(255, 255, 255, .78); }
.groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.count { font-family: var(--head); font-weight: 700; font-size: 18px; color: var(--grey); }
.items { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.item { border-radius: 16px; padding: 16px; background: var(--light); }
.item.open { box-shadow: inset 4px 0 0 var(--secondary); }
.item.closed { opacity: .7; }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item h4 { font-family: var(--head); font-weight: 700; font-size: 18px; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.item-detail { font-size: 13px; line-height: 20px; white-space: pre-line; margin: 8px 0; overflow-wrap: anywhere; }
.item-rec { font-size: 13px; line-height: 20px; margin: 0 0 10px; overflow-wrap: anywhere; }
.item-rec b { font-weight: 400; color: var(--secondary); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.answer { margin-top: 12px; display: grid; gap: 8px; }
.answer[hidden] { display: none; }
.answer label { font-size: 13px; }
.std-grid { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px 12px; align-items: center; }
.std-grid label b { font-weight: 400; overflow-wrap: anywhere; }
.std-grid small { color: var(--grey); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- decisiones, reparto y equipo ---- */
.callout { margin: 8px 0; padding: 10px 14px; border-radius: 14px; background: var(--cyan); color: var(--dark); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.callout a { color: var(--dark); font-weight: 700; }
.callout-card { background: var(--cyan); color: var(--dark); margin-bottom: 20px; }
.callout-card p { margin: 0; }
.item.info { background: var(--white); box-shadow: inset 4px 0 0 var(--cyan), inset 0 0 0 1px var(--line); }
.assign { margin: 10px 0 4px; }
.assign .filters { margin: 8px 0 0; }
td.n, th.n { text-align: right; }
tr.over td { color: var(--err-fg); }
.dialog { border: 0; border-radius: var(--radius); padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); color: var(--primary); background: var(--white); }
.dialog::backdrop { background: rgba(0, 23, 12, .45); }
.members { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 12px; }
.member { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 130px auto auto; gap: 10px 12px; align-items: end; padding: 14px; border-radius: 16px; background: var(--light); }
.member .field { display: grid; gap: 4px; font-size: 13px; min-width: 0; }
.member .field.check { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.member .input { width: 100%; box-sizing: border-box; }

/* ---- auditor: urgencia, mis facturas, esta semana, veredicto, glosario ---- */
.chip.urg-error { background: var(--err-bg); color: var(--err-fg); }
.chip.urg-warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip.urg-pp { background: var(--cyan); color: var(--dark); }
.chip.urg-muted { background: var(--light); color: var(--grey); }
.chips.urgency { margin: 0 0 16px; }
.chips-cell .chip { margin: 0 4px 2px 0; font-size: 12px; }
.chip-btn { text-decoration: none; display: inline-block; }
.chip-btn.on { background: var(--dark); color: var(--white); box-shadow: none; }
.invoices td.reason { white-space: normal; min-width: 220px; overflow-wrap: anywhere; }
.week { margin-top: 20px; }
.kpis + .card { margin-top: 20px; }
.week-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.week-col { border-radius: 16px; padding: 14px 16px; background: var(--light); min-width: 0; }
.week-total { display: grid; text-decoration: none; margin-bottom: 8px; }
.week-total strong { font-family: var(--head); font-weight: 700; font-size: 36px; line-height: 1.05; color: var(--dark); }
.week-total span { font-size: 13px; color: var(--grey); }
.week-col.urg-error { box-shadow: inset 4px 0 0 var(--alert); }
.week-col.urg-warn { box-shadow: inset 4px 0 0 #E0A100; }
.week-col.urg-pp { box-shadow: inset 4px 0 0 var(--secondary); }
.week-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.week-list li { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.week-list a { overflow-wrap: anywhere; min-width: 0; }
.week-list b { font-weight: 400; color: var(--grey); }
.verdict { margin-top: 20px; }
.verdict.ok { background: var(--dark); color: var(--white); }
.verdict.ok a { color: var(--cyan); }
.verdict.wait { box-shadow: inset 6px 0 0 #E0A100; }
.verdict-pending { font-family: var(--head); font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.plain { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.rules { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; font-family: var(--head); font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.rules li::before { content: "› "; color: var(--cyan); }
.tech { margin-top: 10px; font-size: 13px; }
.tech summary, .glossary summary { cursor: pointer; font-size: 13px; }
.why .tech p, .why .glossary { color: rgba(255, 255, 255, .85); }
.glossary { margin-top: 14px; font-size: 13px; line-height: 19px; }
.glossary dl { margin: 8px 0 0; display: grid; gap: 2px 0; }
.glossary dt { font-weight: 700; margin-top: 6px; }
.glossary dd { margin: 0; overflow-wrap: anywhere; }
.h3.spaced { margin-top: 24px; }
.item.focus { box-shadow: inset 4px 0 0 var(--secondary), 0 0 0 3px var(--cyan); }

/* ---- conversación ---- */
.chat { position: sticky; top: 104px; margin-top: 32px; height: calc(100vh - 128px); min-height: 480px; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 18px; gap: 12px; min-width: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.chat-head h2 { font-family: var(--head); font-weight: 300; font-size: 34px; line-height: 1; margin: 0 0 4px; }
.chat-head p { margin: 0; }
.chat .close { display: none; }
.chat-provider { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--grey); }
.msgs { list-style: none; margin: 0; padding: 4px 2px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; min-height: 120px; }
.msg { padding: 10px 14px; border-radius: 16px; max-width: 94%; font-size: 13px; line-height: 20px; animation: rise .35s ease-out; }
.msg p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.msg.me { background: var(--light); align-self: flex-end; }
.msg.ag { background: var(--cyan); color: var(--dark); align-self: flex-start; }
.msg.err { background: var(--err-bg); color: var(--err-fg); }
.msg.hint { background: var(--light); color: var(--primary); }
.msg .via { margin-top: 6px; font-size: 11px; color: var(--primary); opacity: .75; }
.msg .via.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--white); opacity: 1; }
.msg .via.badge.local { background: var(--light); }
.msg.waiting { display: flex; align-items: center; gap: 8px; }
.msg .spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .msg .spinner { animation: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip.tool { background: var(--dark); color: var(--cyan); font-size: 12px; padding: 1px 10px; }
.chip.tool::before { content: "⚙ "; }
.action { margin-top: 8px; padding: 12px 14px; border-radius: 14px; background: var(--light); color: var(--primary); font-size: 13px; line-height: 20px; }
.msg .action { background: var(--white); }
.action p { margin: 0 0 8px; font-weight: 400; }
.action.settled { opacity: .75; }
.pending .h4 { margin-top: 0; }
.pending:empty { display: none; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer .input { border-radius: 18px; }
.btn.send { padding: 12px; }
.fab { display: none; }

/* ---- responsive ---- */
@media (max-width: 1240px) {
  .tabs .tab { padding: 7px 12px; font-size: 15px; }
  .brand .product { display: none; }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .chat { position: fixed; z-index: 40; top: auto; bottom: 0; right: 0; left: 0; margin: 0; height: min(78vh, 640px); border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(105%); visibility: hidden; transition: transform .3s, visibility .3s; }
  .chat.open { transform: none; visibility: visible; }
  .chat .close { display: grid; }
  .fab { display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 35; font-family: var(--head); font-weight: 700; font-size: 16px; color: var(--white); background: var(--dark);
    border: 0; border-radius: 100px; padding: 13px 22px; box-shadow: 0 14px 34px rgba(0, 23, 13, .25); cursor: pointer; }
  .fab::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); margin: auto 10px auto 0; }
  body.chat-open .fab { display: none; }
}
@media (max-width: 900px) {
  header.site { position: relative; top: 0; margin-top: 8px; padding: 0 8px; }
  header.site .pill { border-radius: 28px; flex-wrap: wrap; justify-content: center; padding: 12px 14px; gap: 10px; }
  nav { order: 3; width: 100%; }
  .tabs { justify-content: center; flex-wrap: wrap; border-radius: 22px; }
  .week-cols { grid-template-columns: minmax(0, 1fr); }
  .tabs .tab { padding: 6px 10px; font-size: 15px; }
  .tools { flex-wrap: wrap; justify-content: center; }
  .hero { padding: 36px 0 18px; }
  .hero h1 { font-size: 44px; line-height: 42px; }
  .lead { font-size: 16px; line-height: 26px; }
  .kpis, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.three { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-1-2, .grid-2-1, .groups { grid-template-columns: minmax(0, 1fr); }
  .kpi strong { font-size: 34px; }
  .lot { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .lot-when, .lot-dur { grid-column: 2 / -1; text-align: left; }
  .lot-dur { margin-top: -10px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .new-run { border-radius: 22px; padding: 14px; }
  .card { padding: 18px; }
  .select { max-width: 100%; }
  .member { grid-template-columns: minmax(0, 1fr); }
  .invoices { box-shadow: none; overflow: visible; }
  .invoices thead { display: none; }
  .invoices tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 10px 12px; border-radius: 14px; background: var(--light); margin-bottom: 10px; }
  .invoices td, .invoices td.reason { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; border: 0; padding: 3px 0; white-space: normal;
    overflow-wrap: anywhere; width: auto; min-width: 0; justify-self: stretch; text-align: left; }
  .invoices td::before { content: attr(data-label); color: var(--grey); font-size: 12px; }
  .chip-row { display: flex; flex-wrap: wrap; gap: 4px; }
  .member .field.check { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Frentes view */
.frentes { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.frente code { display: block; overflow-wrap: anywhere; margin: 4px 0 12px; }
.frente.selected { outline: 2px solid var(--secondary); outline-offset: -2px; }
#frente-doc { scroll-margin-top: 16px; }
.doc-table { overflow-x: auto; max-width: 100%; font-size: 12px; white-space: pre; }
.doc-li { margin: 4px 0; }
#frente-doc { min-width: 0; overflow-wrap: anywhere; }
