/* Kuotia: the pieces of «Buscamos tus facturas» (autonomos/buscamos_facturas.html, seo-map §3b). Load after
   kuotia-site.css and kuotia-explain.css. Reusable on any page that tells how invoices arrive by themselves:
   - .pv-cx: Documentos with the connections on top, invoices arriving with their origin and the gestor's notice of the
     missing one (pv/_conexiones.html, js/kuotia-explain.js, two beats; final frame without JS, with reduced motion or
     under 600 px).
   - .pv-wa: a WhatsApp chat with Kuotia (pv/_wa.html): a photo, a transcribed voice note and the gestor's reply.
   - .pf-chores + .pf-cost: a list of chores with icons and what a forgotten invoice costs, as one stacked bar whose
     parts say their figure and their word (slate IVA, blue IRPF; amber only for what is missing).
   - .pf-conn: what can be connected, one card per source with its marks and its way without connecting (.pf-conn-alt).
   - .pf-never: what you no longer do, struck through.
   - .pf-miss: a quarter by supplier and month as a real table (received in green with its word, the missing one dashed
     amber with «Falta», what is not due neutral with «No toca») and a bank charge without its invoice.
   Colours always come with their word. */
.pf { --pf-warn-ink: #8a5300; }
:root[data-theme="dark"] .pf { --pf-warn-ink: #f0b552; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pf { --pf-warn-ink: #f0b552; } }

/* Head: Documentos with its connections */
.page-head-pv .wrap > .pv-cx { grid-column: 7 / -1; }
.pv-cx { margin: 0; font-size: 14px; color: var(--ink); }
.pv-cx-conn { list-style: none; margin: 14px 18px 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pv-cx-conn li { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; }
.pv-cx-conn li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-cx-conn .logo-mark, .pv-cx-conn .pv-i { width: 16px; height: 16px; flex: none; color: var(--ink); }
.pv-cx-conn li i { margin-left: auto; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--success-mark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success-mark) 20%, transparent); }
.pv-cx .pv-cx-k { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 18px 2px; font-size: 12px; font-weight: 650; color: var(--muted); }
.pv-cx-live { color: var(--accent-ink); }
.pv-cx:not(.is-live) .pv-cx-live { display: none; }
.pv-cx.is-live .pv-cx-live { opacity: 0; transition: opacity .3s ease; }
.pv-cx.is-live .pv-cx-live.on { opacity: 1; }
.pv-cx-rows { margin: 0 18px; }
.pv-cx-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.pv-cx-row .pv-name small { color: var(--muted); font-size: 12px; }
.pv-cx-row .pv-name small .logo-mark { width: 12px; height: 12px; color: var(--ink-2); }
.pv-cx-row .pv-name small > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-cx-row .pv-name small em { font-style: normal; }
.pf .lane-txt .who.is-sys { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }
.pv-cx-amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.kx.is-live .pv-cx-row[data-in] { transition-delay: var(--d, 0s); }
.pv-cx-miss { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 14px 18px 0; padding: 12px; border-radius: 12px; border: 1px dashed var(--warn-line); background: var(--warn-soft); }
.pv-cx-miss .pv-av { position: static; }
.pv-cx-miss-t { min-width: 0; display: grid; gap: 2px; }
.pv-cx-miss-t small { font-size: 11.5px; font-weight: 650; color: var(--pf-warn-ink); }
.pv-cx-miss-t b { font-size: 13.5px; font-weight: 640; line-height: 1.3; }
.pv-cx-months { display: flex; gap: 4px; margin-top: 4px; }
.pv-cx-months i { font-style: normal; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 6px; border-radius: 5px; color: var(--success); background: color-mix(in srgb, var(--success-mark) 12%, var(--surface)); }
.pv-cx-months i.is-gap { color: var(--pf-warn-ink); background: var(--surface); outline: 1px dashed var(--warn-line); outline-offset: -1px; }
.pv-cx-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); }
.pv-cx-foot .pv-i { width: 14px; height: 14px; color: var(--success-mark); flex: none; }
.pv-cx-ctrl { position: absolute; right: 12px; top: 5px; }
.pv-cx-ctrl .kx-chap { display: none; }
.pv-cx-ctrl .kx-toggle { width: 36px; height: 36px; border-radius: 9px; }
.pv-cx:not(.is-live) .pv-cx-ctrl { display: none; }
@container (max-width: 430px) {
  .pv-cx-conn { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-cx-miss { grid-template-columns: minmax(0, 1fr) auto; }
  .pv-cx-miss .pv-av { display: none; }
  .pv-cx-row .pv-name small em { display: none; }
}

/* WhatsApp chat */
.pv-wa { background: var(--surface); }
.pv-wa-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pv-wa-head .logo-mark { width: 22px; height: 22px; color: #1a9e55; }
:root[data-theme="dark"] .pv-wa-head .logo-mark { color: #4cd486; }
.pv-wa-head b { display: block; font-size: 14px; }
.pv-wa-head small { display: block; font-size: 12px; color: var(--muted); }
.pv-wa-body { display: grid; gap: 10px; padding: 16px; background: color-mix(in srgb, #1a9e55 5%, var(--bg-soft)); }
.pv-wa-msg { position: relative; max-width: 84%; justify-self: start; padding: 8px 11px 18px; border-radius: 4px 12px 12px 12px; background: var(--surface); border: 1px solid var(--line); }
.pv-wa-msg.is-me { justify-self: end; border-radius: 12px 4px 12px 12px; background: color-mix(in srgb, #1a9e55 14%, var(--surface)); border-color: color-mix(in srgb, #1a9e55 25%, var(--line)); }
.pv-wa-msg p { font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.pv-wa-who { display: block; font-size: 11.5px; font-weight: 650; color: var(--accent-ink); margin-bottom: 2px; }
.pv-wa-time { position: absolute; right: 9px; bottom: 4px; font-size: 10.5px; color: var(--muted); }
.pv-wa-photo { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.pv-wa-photo .pv-thumb { width: 44px; height: 54px; }

/* The chores and what a forgotten invoice costs */
.pf-pain { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--col-gap); align-items: start; }
.pf-chores { list-style: none; margin: 0; padding: 6px 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sheet); }
.pf-chores li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 18px; }
.pf-chores li + li { border-top: 1px solid var(--line); }
.pf-chores li > .pv-i { width: 36px; height: 36px; padding: 8px; border-radius: 10px; color: var(--accent-ink); background: var(--accent-soft); }
.pf-chores b { display: block; font-weight: 620; color: var(--ink); line-height: 1.35; }
.pf-chores small { display: block; margin-top: 3px; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.45; }
.pf-cost { padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.pf-cost-k { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.pf-cost-n { margin-top: 6px; font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3rem); font-weight: 700; letter-spacing: -.035em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.pf-cost-bar { display: flex; gap: 3px; margin-top: 18px; }
.pf-cost-bar > span { flex: var(--w) 1 0; min-width: 0; display: grid; gap: 1px; padding: 10px 10px 9px; border-radius: 8px; color: #fff; }
.pf-cost-bar > span.is-iva { background: #667085; }
.pf-cost-bar > span.is-irpf { background: #1d6fa5; }
:root[data-theme="dark"] .pf-cost-bar > span.is-iva { background: #3a4659; }
:root[data-theme="dark"] .pf-cost-bar > span.is-irpf { background: #1f5f8f; }
.pf-cost-bar b { font-size: 1.0625rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.pf-cost-bar small { font-size: 12px; opacity: .92; }
.pf-cost-note { margin-top: 14px; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; }

/* What you connect */
.pf-conn { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.pf-conn > li { grid-column: span 2; padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.pf-conn > li { display: flex; flex-direction: column; }
.pf-conn > li.is-hand { border-style: dashed; background: transparent; }
.pf-conn .pf-conn-alt { margin-top: auto; padding-top: 14px; display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }
.pf-conn-alt .logo-mark { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ink-2); }
.pf-conn-m { display: flex; gap: 8px; }
.pf-conn-m .logo-mark, .pf-conn-m .pv-i { width: 40px; height: 40px; padding: 9px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink); }
.pf-conn h3 { margin-top: 16px; font-size: 1.125rem; letter-spacing: -.01em; }
.pf-conn p { margin-top: 6px; color: var(--ink-2); line-height: 1.55; }
.pf-never { margin-top: 28px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 28px; align-items: center; padding: 18px 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.pf-never h3 { font-size: 1rem; }
.pf-never ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pf-never li { font-size: var(--fs-sm); color: var(--muted); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent); }

/* The missing invoice, by supplier and month */
.pf-miss { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sheet); overflow: hidden; }
.pf-miss table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pf-miss caption { caption-side: top; text-align: left; padding: 14px 18px 10px; font-size: var(--fs-xs); font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line); }
.pf-miss th, .pf-miss td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.pf-miss thead th { font-size: var(--fs-xs); font-weight: 650; color: var(--muted); padding-top: 10px; padding-bottom: 10px; }
.pf-miss thead th:first-child, .pf-miss tbody th { text-align: left; padding-left: 18px; width: 40%; }
.pf-miss tbody th b { display: block; font-weight: 620; color: var(--ink); line-height: 1.3; }
.pf-miss tbody th small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.pf-miss td > span { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.pf-miss td.is-ok { color: var(--success); }
.pf-miss td.is-ok .pv-i { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; stroke-width: 2.4; }
.pf-miss td.is-ok > span { padding-left: 0; }
.pf-miss td.is-gap > span { color: var(--pf-warn-ink); background: var(--warn-soft); outline: 1.5px dashed var(--warn-line); outline-offset: -1.5px; }
.pf-miss td.is-none > span { color: var(--muted); }
.pf-bankrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.pf-bankrow > .pv-i { width: 36px; height: 36px; padding: 8px; border-radius: 10px; color: var(--ink); background: var(--bg-soft); border: 1px solid var(--line); }
.pf-bankrow b { display: block; font-weight: 620; color: var(--ink); font-size: var(--fs-sm); }
.pf-bankrow small { display: block; font-size: 12px; color: var(--muted); }
.pf-tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; color: var(--pf-warn-ink); background: var(--warn-soft); outline: 1.5px dashed var(--warn-line); outline-offset: -1.5px; }
.pf-miss-out { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 18px; }
.pf-miss-out .pv-av { position: static; flex: none; }
.pf-miss-out p { margin: 0; padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: var(--bg-soft); font-size: var(--fs-sm); line-height: 1.5; color: var(--ink); }
.pf-miss-out small { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 650; color: var(--muted); }
.pf-kinds { margin-top: 20px; }
.pf-kinds > div { grid-template-columns: 200px minmax(0, 1fr); }
.pf-kinds dt .pv-i { color: var(--accent-ink); }

.pf-plans .plan { padding: 24px; }
.pf-plans .plan-price .n { font-size: 2.25rem; }
.pf-plans-more { margin-top: 18px; }

@media (max-width: 960px) {
  .page-head-pv .wrap > .pv-cx { grid-column: 1; max-width: 560px; }
  .pf-pain { grid-template-columns: minmax(0, 1fr); }
  .pf-conn { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-conn > li { grid-column: span 1; }
  .pf-never { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pf-conn { grid-template-columns: minmax(0, 1fr); }
  .pf-conn > li { padding: 18px; }
  .pf-kinds > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pf-miss th, .pf-miss td { padding: 10px 4px; }
  .pf-miss thead th:first-child, .pf-miss tbody th { padding-left: 14px; width: 44%; }
  .pf-miss td.is-ok > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pf-miss td.is-ok .pv-i { width: 20px; height: 20px; margin-right: 0; }
  .pf-miss td > span { font-size: 12px; padding: 3px 6px; }
  .pf-plans { grid-template-columns: minmax(0, 1fr); }
  .pf-miss thead th:first-child, .pf-miss tbody th { width: 38%; }
  .pf-miss tr > :last-child { padding-right: 12px; }
  .pf-never ul { flex-direction: column; align-items: flex-start; }
  .pf-never li { border-radius: 10px; }
  .pf-conn > li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; }
  .pf-conn-m { grid-row: 1 / span 2; flex-direction: column; }
  .pf-conn h3 { margin-top: 0; }
  .pf-conn > li { display: grid; }
  .pf-conn h3, .pf-conn p { grid-column: 2; }
  .pf-conn .pf-conn-alt { padding-top: 10px; }
  .pf-plans-more a { position: relative; }
  .pf-plans-more a::after { content: ""; position: absolute; inset: -10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .kx.is-live .pv-cx-row[data-in] { transition-delay: 0s; }
}
.pf a[href^="https://wa.me/"] { white-space: nowrap; }
@media (max-width: 600px) {
  .pf .cta-flow .cta-row .btn { min-width: 0; padding-inline: 12px; font-size: 15.5px; line-height: 1.2; text-align: center; }
  .pf .cta-flow .cta-row .btn .logo-mark { flex: none; }
}
@media (min-width: 961px) {
  .pf .feature-art { align-self: start; position: sticky; top: 96px; }
}
