/* Cuaderno de campo — 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; overflow-wrap: anywhere; }
.next-what { font-size: 0.98rem; font-weight: 500; opacity: 0.92; }
.tool-body { padding: 1.1rem; }

/* Barra */
.bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-left: auto; }
.filters label { font-size: 0.85rem; font-weight: 700; }
.filters select, .filters input { display: block; min-width: 10rem; }
input:not([type="checkbox"]), select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--ink); width: 100%; margin-top: 0.2rem;
  padding: 0.45rem 0.6rem; border: 2px solid var(--ink); border-radius: 4px; background: #fff; min-height: 42px;
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 0; }
.btn-primary {
  font: inherit; font-weight: 700; color: var(--paper); background: var(--ink); cursor: pointer;
  border: 2px solid var(--ink); border-radius: 6px; padding: 0.55rem 1.1rem; min-height: 44px; box-shadow: 4px 4px 0 var(--amber);
}
.btn-primary:hover { background: #0b1d29; }
.btn-link { font: inherit; color: var(--ink); 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; }

/* Formularios */
.panel { background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: 0.9rem; margin: 1rem 0; }
.panel h3 { margin-bottom: 0.7rem; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7rem 0.9rem; }
@media (min-width: 640px) { .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grid .wide { grid-column: 1 / -1; } }
.grid label, .panel label { display: block; font-size: 0.88rem; font-weight: 700; }
.grid small, .panel label small { font-weight: 400; color: var(--pencil); }
.with-unit { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.with-unit input { width: 7rem; }
.panel-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 0.9rem; }

/* Lista */
.list { margin-top: 1.1rem; border-top: 2px solid var(--ink); }
.list .empty { padding: 1rem 0.2rem; color: var(--pencil); margin: 0; }
.group-title { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pencil); font-weight: 700; margin: 0.9rem 0.2rem 0.2rem; }
.eq { border-bottom: 1px solid var(--line); padding: 0.7rem 0.2rem; }
.eq-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.4rem 1rem; }
@media (min-width: 760px) { .eq-head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.eq-name { font-weight: 700; font-size: 1.02rem; overflow-wrap: anywhere; }
.eq-sub { display: block; font-size: 0.86rem; color: var(--pencil); font-weight: 400; overflow-wrap: anywhere; }
.st .lbl { display: block; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pencil); font-weight: 700; }
.st .when { display: block; font-size: 0.86rem; color: var(--pencil); }
.badge { display: inline-block; font-size: 0.82rem; 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-soon { background: var(--amber-soft); }
.b-late { background: rgba(168, 50, 74, 0.15); color: #7d1f33; }
.b-off { color: var(--pencil); }
.acts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.mini {
  font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--ink); cursor: pointer;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0.2rem 0.6rem; min-height: 34px;
}
.mini:hover, .mini:focus-visible { background: var(--amber-soft); }
.mini.danger { border-color: var(--no); color: var(--no); }
.mini[aria-expanded="true"] { background: var(--paper); box-shadow: 2px 2px 0 var(--amber); }

.save-note { font-size: 0.85rem; color: var(--pencil); margin: 1rem 0 0; }

.out { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.out-title { font-weight: 700; margin: 0 0 0.6rem; }
.out-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.out-acts .mini:disabled { opacity: 0.45; cursor: not-allowed; background: none; }
.out-msg { margin: 0.6rem 0 0; font-size: 0.9rem; min-height: 1.2em; }
.print-only { display: none; }
/* Cuaderno: finca, pestañas, filas */
.finca { flex: 1 1 16rem; font-size: 0.88rem; font-weight: 700; max-width: 26rem; }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; margin: 1rem 0 0.9rem; }
.tabs button {
  font: inherit; font-size: 0.92rem; font-weight: 700; color: var(--ink); background: #fff; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 6px; padding: 0.45rem 0.3rem; min-height: 44px; line-height: 1.2;
}
.tabs button span { display: block; font-weight: 400; font-size: 0.8rem; color: var(--pencil); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--amber); }
.tabs button[aria-selected="true"] span { color: var(--amber); }
@media (max-width: 520px) { .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bar-tab { align-items: flex-end; }
.filter { font-size: 0.85rem; font-weight: 700; margin-left: auto; min-width: 11rem; }
@media (max-width: 420px) { .filter { margin-left: 0; width: 100%; } }
.hint { display: block; font-weight: 400; color: var(--pencil); font-size: 0.82rem; margin-top: 0.2rem; }
.row { border-bottom: 1px solid var(--line); padding: 0.7rem 0.2rem; }
.row-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.35rem 1rem; }
@media (min-width: 760px) { .row-head { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.88rem; font-weight: 700; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.35rem; white-space: nowrap; }
.warn { margin: 0.45rem 0 0; font-size: 0.88rem; color: #7d1f33; background: rgba(168, 50, 74, 0.1); border-left: 3px solid var(--no); padding: 0.3rem 0.5rem; }
.code-search { margin: 0 0 0.8rem; font-size: 0.88rem; font-weight: 700; max-width: 26rem; }
.code-row { display: flex; gap: 0.4rem; align-items: stretch; margin-top: 0.2rem; }
.code-row input { margin-top: 0; }
.code-row .mini { white-space: nowrap; }
.report { background: #fff; }
.report-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.6rem; }
.report-bar h3 { margin: 0; }
.report-bar label { font-size: 0.85rem; }
.rep h4 { font-family: var(--serif); font-weight: 400; font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.rep-meta { color: var(--pencil); font-size: 0.88rem; margin: 0 0 0.5rem; }
.rep-ok { margin: 0.5rem 0; font-size: 0.92rem; color: var(--ok); font-weight: 700; }
.rep-wrap { overflow-x: auto; }
.rep table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.rep th, .rep td { text-align: left; padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.rep th { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pencil); }
.rep .num { text-align: right; white-space: nowrap; }
.rep .none { color: var(--pencil); font-size: 0.9rem; }
.pos { color: var(--ok); }
.neg { color: var(--no); }
.eco-total { margin: 0.8rem 0.2rem 0.2rem; font-size: 0.92rem; }
.month { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pencil); font-weight: 700; margin: 0.9rem 0.2rem 0.1rem; }

@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000; }
  .top, .intro, .how, .seo, .faq, .foot, .ad-slot, .next, .noscript, .tool-body > *:not(#cc-print) { display: none !important; }
  main, .tool, .tool-body { margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important; width: auto !important; max-width: none !important; }
  #cc-print { display: block; font-size: 10pt; }
  #cc-print h2 { font-size: 15pt; margin: 0 0 2mm; }
  #cc-print h4 { font-size: 11.5pt; margin: 5mm 0 2mm; font-family: var(--serif); font-weight: 400; }
  #cc-print .rep-meta { color: #444; font-size: 9pt; }
  #cc-print table { width: 100%; border-collapse: collapse; margin-bottom: 3mm; }
  #cc-print th, #cc-print td { border: 1px solid #999; padding: 1.2mm 1.8mm; text-align: left; vertical-align: top; font-size: 9pt; }
  #cc-print th { background: #eee; text-transform: none; letter-spacing: 0; color: #000; }
  #cc-print .num { text-align: right; white-space: nowrap; }
  #cc-print tr { break-inside: avoid; }
  #cc-print .warn { color: #000; background: none; border: 1px solid #000; }
  #cc-print .rep-ok { color: #000; }
  #cc-print .firma { margin-top: 14mm; display: flex; gap: 20mm; }
  #cc-print .firma span { flex: 1; border-top: 1px solid #000; padding-top: 1mm; font-size: 9pt; }
}

.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; }
  .filters { margin-left: 0; width: 100%; }
  .filters label { flex: 1 1 100%; }
}
@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; }
