/* Páginas de calendario por patrón */
.calp { padding-top: 40px; padding-bottom: 24px; }
.calp-intro { max-width: 760px; margin-bottom: 32px; }
.calp-intro h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); margin-bottom: 14px; }
.calp-intro .lead { font-size: 1.1rem; color: var(--ink-soft); }
.crumbs { font: 500 0.8rem var(--font-mono); color: var(--ink-soft); margin-bottom: 16px; display: block; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 36px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.fact b { display: block; font: 600 1.5rem var(--font-mono); }
.fact span { font-size: 0.82rem; color: var(--ink-soft); }

.cycle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 40px; overflow-x: auto; }
.cycle h2 { font-size: 1.15rem; margin-bottom: 14px; }
.cycle-grid { display: grid; grid-template-columns: 70px repeat(7, minmax(30px, 1fr)); gap: 6px; align-items: center; min-width: 330px; }
.cycle-grid .h { font: 500 0.72rem var(--font-mono); color: var(--ink-dim); text-align: center; }
.cycle-grid .w { font: 500 0.78rem var(--font-mono); color: var(--ink-soft); }
.cycle-grid i { aspect-ratio: 1; border-radius: 50%; display: block; max-width: 34px; justify-self: center; width: 100%; }
.cycle .legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 0.85rem; color: var(--ink-soft); }
.cycle .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
i.A { background: var(--accent); }
i.B { box-shadow: inset 0 0 0 1.5px var(--ink-soft); }

.planner h2 { margin-bottom: 18px; }
.controls { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 24px; align-items: end; }
.controls label { display: grid; gap: 6px; font-size: 0.88rem; font-weight: 600; }
.controls .input, .controls select { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; font: 1rem var(--font-body); }
.controls .mono { font-family: var(--font-mono); }
.controls .range { display: grid; gap: 6px; min-width: 0; }
.controls .rl { font-size: 0.88rem; font-weight: 600; }
.controls .rs { display: grid; grid-template-columns: 1.5fr 1fr; gap: 6px; }
.range-err { color: #E08787; font-size: 0.88rem; margin: 0 0 10px; min-height: 0; }
:root[data-theme="light"] .range-err { color: #A33E3E; }
.ctrl-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.year-sum { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: baseline; margin-bottom: 18px; font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink-soft); }
.year-sum b { color: var(--ink); font-weight: 600; }
.year { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.month-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.month-head h3 { font-size: 1rem; }
.month-head span { font: 500 0.72rem var(--font-mono); color: var(--ink-soft); }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mgrid .wd { font: 500 0.62rem var(--font-mono); color: var(--ink-dim); text-align: center; }
.mgrid .d { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font: 500 0.66rem var(--font-mono); }
.mgrid .d.A { background: var(--accent); color: var(--on-accent); }
.mgrid .d.B { box-shadow: inset 0 0 0 1.3px var(--ink-dim); color: var(--ink-soft); }

.explain { max-width: 720px; padding: 56px 0 8px; }
.explain h2 { margin: 32px 0 12px; font-size: 1.4rem; }
.explain p, .explain li { color: var(--ink); opacity: 0.92; margin-bottom: 12px; }
.explain ul { padding-left: 22px; }
.explain a { color: var(--accent-ink); }
.others { padding: 40px 0 0; }
.others h2 { font-size: 1.3rem; margin-bottom: 14px; }
.others .grid a { text-decoration: none; }
.others .card:hover { border-color: var(--ink-dim); }
.others .card b { font-family: var(--font-title); display: block; margin-bottom: 4px; }

.printyear { display: none; }
@media print {
  /* Vertical, una hoja. Margen 0 para que el navegador no imprima fecha ni URL; el margen va adentro. */
  @page { size: A4 portrait; margin: 0; }
  body { background: #fff; color: #000; }
  body > *:not(.printyear) { display: none !important; }
  .printyear { display: block; color: #000; font-family: var(--font-body); padding: 12mm 12mm 10mm; }
  .py-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10mm; border-bottom: 1.5pt solid #000; padding-bottom: 5pt; margin-bottom: 8pt; }
  .py-head h1 { font: 700 18pt var(--font-title); margin: 0; }
  .py-head div { font: 500 8pt var(--font-mono); text-align: right; line-height: 1.5; }
  .py-legend { display: flex; gap: 16pt; font-size: 9pt; margin-bottom: 10pt; }
  .py-legend i { display: inline-block; width: 8pt; height: 8pt; border-radius: 50%; border: 0.8pt solid #000; margin-right: 4pt; vertical-align: -0.5pt; }
  .py-legend i.A { background: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .py-grid { display: grid; grid-template-columns: repeat(3, 56mm); justify-content: space-between; row-gap: 9pt; }
  .py-m h3 { font: 600 10pt var(--font-title); margin: 0 0 3pt; display: flex; justify-content: space-between; align-items: baseline; }
  .py-m h3 span { font: 500 7pt var(--font-mono); }
  .py-c { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2pt; }
  .py-c span { font: 500 6.5pt var(--font-mono); text-align: center; }
  .py-c i { aspect-ratio: 1; border-radius: 50%; border: 0.8pt solid #000; display: grid; place-items: center; font: 500 6.5pt var(--font-mono); font-style: normal; }
  .py-c i.A { background: #000; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .py-c i.x { border: 0; }
  .py-foot { font-size: 7pt; margin-top: 10pt; border-top: 0.5pt solid #000; padding-top: 4pt; }
}
