/* Conciliar pagos — papel cuadriculado de tkaed */

:root {
  --paper: #f2f6f3;
  --card: #ffffff;
  --ink: #112a3a;
  --pencil: #4d626e;
  --line: rgba(17, 42, 58, 0.14);
  --amber: #f2b632;
  --amber-soft: rgba(242, 182, 50, 0.32);
  --ok: #2e7d5b;
  --no: #a8324a;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.6; color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

main, .top, .foot { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.brand { font-family: var(--serif); font-size: 1.1rem; text-decoration: none; }
.top nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.top nav a { text-decoration: none; border-bottom: 2px solid transparent; }
.top nav a:hover { border-bottom-color: var(--amber); }

.intro { padding: 0.6rem 0 1.2rem; max-width: 46rem; }
.intro h1 { font-size: clamp(1.85rem, 6vw, 3.2rem); margin-bottom: 0.5rem; }
.lede { font-size: 1.05rem; color: var(--pencil); max-width: 40rem; margin: 0; }

.tool { background: var(--card); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 7px 7px 0 var(--amber); overflow: hidden; margin-bottom: 2rem; }
.next { background: var(--ink); color: var(--paper); padding: 1rem 1.1rem 1.1rem; }
.next p { margin: 0; }
.next-label { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.next-date { font-family: var(--serif); font-size: clamp(1.4rem, 4.5vw, 1.9rem); line-height: 1.2; }
.next-what { font-size: 0.98rem; font-weight: 500; opacity: 0.92; }
.tool-body { padding: 1.1rem; }

/* Archivos */
.files { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 760px) { .files { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.file-box h3 { margin-bottom: 0.5rem; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 112px; padding: 0.9rem; cursor: pointer;
  border: 2px dashed var(--ink); border-radius: 6px; background: #fff;
}
.drop:hover, .drop.over { background: var(--amber-soft); }
.drop:focus-within { outline: 3px solid var(--amber); outline-offset: 2px; }
.drop-main { font-weight: 700; font-size: 1.05rem; }
.drop-sub { font-size: 0.88rem; color: var(--pencil); }
.file-box.loaded .drop { min-height: 0; flex-direction: row; gap: 0.5rem; padding: 0.5rem 0.8rem; border-style: solid; justify-content: flex-start; text-align: left; }
.file-box.loaded .drop-main { white-space: nowrap; }
.file-box.loaded .drop-main::before { content: "✓ "; color: var(--ok); }
.file-box.loaded .drop-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-info { margin-top: 0.7rem; }
.file-meta { font-size: 0.88rem; color: var(--pencil); margin: 0 0 0.5rem; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem 0.7rem; }
.cols label { display: block; font-size: 0.85rem; font-weight: 700; }
.cols label.wide { grid-column: 1 / -1; }
select, input[type="number"] {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink); background: #fff;
  border: 2px solid var(--ink); border-radius: 4px; padding: 0.4rem 0.5rem; min-height: 42px; margin-top: 0.15rem;
}
select { cursor: pointer; }
.cols .hdr-row { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.cols .hdr-row input { width: 5rem; margin: 0; }

.go { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem 1rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.go-days { font-size: 0.85rem; font-weight: 700; }
.go-days select { width: auto; min-width: 9rem; display: block; }
.btn-primary {
  font: inherit; font-weight: 700; font-size: 1.02rem; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 4px; padding: 0.65rem 1rem; min-height: 46px;
}
.btn-primary:hover { background: #0b1d29; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-link { font: inherit; background: none; border: 0; padding: 0.6rem 0.2rem; cursor: pointer; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.form-msg { margin: 0.7rem 0 0; font-size: 0.95rem; color: var(--no); font-weight: 500; }
.form-msg:empty { display: none; }

/* Resultado */
.result { margin-top: 1.4rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: #fff; border: 2px solid var(--ink); border-radius: 6px; padding: 0.6rem 0.75rem;
  border-top-width: 6px;
}
.tile[aria-selected="true"] { box-shadow: 4px 4px 0 var(--amber); background: var(--paper); }
.tile b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.1; }
.tile span { display: block; font-weight: 700; font-size: 0.9rem; line-height: 1.25; }
.tile small { display: block; color: var(--pencil); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.t-ok { border-top-color: var(--ok); }
.t-sin { border-top-color: var(--amber); }
.t-pag { border-top-color: #5b6fb0; }
.t-dif { border-top-color: var(--no); }
.res-note { font-size: 0.88rem; color: var(--pencil); margin: 0.8rem 0 0.4rem; }
.res-note:empty { display: none; }

.rows { border-top: 2px solid var(--ink); max-height: 34rem; overflow-y: auto; }
.row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem 1rem; padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
@media (min-width: 760px) { .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 8.5rem; align-items: start; } }
.row .side { min-width: 0; }
.row .lbl { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pencil); font-weight: 700; }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.row .txt { color: var(--pencil); overflow-wrap: anywhere; }
.row .none { color: var(--pencil); font-style: italic; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; border-radius: 999px; padding: 0.05rem 0.6rem; background: var(--paper); border: 1px solid var(--line); }
.b-ok { background: rgba(46, 125, 91, 0.14); }
.b-rev { background: var(--amber-soft); }
.b-dif { background: rgba(168, 50, 74, 0.13); }
.row .why { display: block; font-size: 0.8rem; color: var(--pencil); margin-top: 0.15rem; }
.rows .empty { padding: 1rem 0.2rem; color: var(--pencil); }
.more-rows { padding: 0.7rem 0.2rem; font-size: 0.88rem; color: var(--pencil); }

.res-help { font-size: 0.88rem; color: var(--pencil); margin: 0.4rem 0; }
.res-done { font-size: 0.9rem; font-weight: 700; color: var(--ok); margin: 0 0 0.5rem; }
.res-done:empty { display: none; }
.row .acts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.mini {
  font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--ink); cursor: pointer;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0.2rem 0.55rem; min-height: 32px;
}
.mini:hover, .mini:focus-visible { background: var(--amber-soft); }
.pick { background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: 0.7rem; margin: 0.3rem 0 0.6rem; }
.pick label { display: block; font-weight: 700; font-size: 0.9rem; }
.pick input { display: block; width: 100%; margin-top: 0.3rem; font: inherit; padding: 0.45rem 0.6rem; border: 2px solid var(--ink); border-radius: 4px; background: #fff; }
.pick-list { max-height: 18rem; overflow-y: auto; margin: 0.5rem 0; }
.pick-op {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 0.9rem; color: var(--ink); cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 0.45rem 0.6rem; margin-bottom: 0.35rem;
}
.pick-op:hover, .pick-op:focus-visible { border-color: var(--ink); box-shadow: 3px 3px 0 var(--amber); }
.pick-op .side { margin-bottom: 0.15rem; }
.pick-op .lbl { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pencil); font-weight: 700; }
.pick-op .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.pick-op .txt { color: var(--pencil); overflow-wrap: anywhere; }
.pick-op .why { font-size: 0.8rem; color: var(--pencil); }
.export { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; font-weight: 700; font-size: 0.95rem; }
.btn-out {
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; min-height: 40px;
  background: #fff; border: 2px solid var(--ink); border-radius: 6px; padding: 0.35rem 0.9rem; box-shadow: 3px 3px 0 var(--amber);
}
.btn-out:hover, .btn-out:focus-visible { background: var(--amber-soft); }

.ad-slot { min-height: 90px; margin: 2rem 0; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 4px; color: rgba(77, 98, 110, 0.55); font-size: 0.8rem; }

.how, .seo, .faq { max-width: 46rem; margin: 3rem 0; }
.how h2, .faq h2 { margin-bottom: 1rem; }
.seo h2 { margin: 1.8rem 0 0.8rem; }
.seo h2:first-child { margin-top: 0; }
.steps { padding-left: 1.4rem; margin: 0; }
.steps li { margin-bottom: 0.8rem; padding-left: 0.3rem; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq details p { margin: 0.6rem 0 0; color: var(--pencil); }

.foot { padding: 2rem 0 3rem; border-top: 2px solid var(--ink); color: var(--pencil); font-size: 0.9rem; }
.foot p { margin: 0; }
.noscript { background: var(--amber); padding: 1rem; text-align: center; margin: 0; }

@media (max-width: 420px) {
  .top nav a[href="#como-funciona"] { display: none; }
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Escondido hasta que AdSense apruebe; entonces borrar esta regla y poner los bloques. */
.ad-slot { display: none !important; }
