/* ============================================================
   ManOS — Worksheet Design System
   Charcoal, bone and one line of gold, from the book cover.
   Optimised for print (A4/Letter) with on-screen preview
   ============================================================ */

:root {
  --paper:    #F7F2E9;
  --bone:     #EFE8DA;
  --linen:    #E6DCCB;
  --ink:      #221B14;
  --ink-soft: #5C5245;
  --gold:    #8F6D24;
  --brass:    #A8823C;
  --wash:     #F1EAD8;
  --char:     #1A150F;
  --rule:     rgba(34, 27, 20, 0.2);
  --rule-soft:rgba(34, 27, 20, 0.08);
}

* { box-sizing: border-box; }

.worksheet-shell {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  padding: 2rem 0 4rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.display-xxl {
  font-family: 'Literata', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 80, "opsz" 144;
  color: var(--ink);
}

.display-xl {
  font-family: 'Literata', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 60, "opsz" 72;
  color: var(--ink);
}

.display-l {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 50, "opsz" 48;
  color: var(--ink);
}

.display-m {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.25;
  color: var(--ink);
}

.italic-serif {
  font-family: 'Literata', Georgia, serif;
  font-style: italic;
  font-weight: 300;
}

.eyebrow {
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--char);
}

.body {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
}

.body-lg {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
}

.body-sm {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.caption {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.page {
  max-width: 210mm;
  min-height: 297mm;
  margin: 2rem auto;
  background: var(--paper);
  padding: 20mm 18mm;
  position: relative;
  box-shadow: 0 2px 24px rgba(42, 32, 27, 0.08);
}

.page + .page {
  margin-top: 3rem;
}

/* ============================================================
   PAGE HEADER & FOOTER
   ============================================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 2.5rem;
}

.page-header .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-header .brand-name {
  font-family: 'Literata', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.page-header .reference {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.page-footer {
  position: absolute;
  left: 18mm;
  right: 18mm;
  bottom: 12mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.68rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   WORKSHEET TITLE BLOCK
   ============================================================ */

.worksheet-title-block {
  margin-bottom: 2.5rem;
}

.worksheet-title-block .eyebrow {
  margin-bottom: 0.75rem;
  display: block;
}

.worksheet-title-block h1 {
  margin: 0 0 0.75rem 0;
}

.worksheet-title-block .worksheet-intro {
  max-width: 38rem;
  margin-top: 1rem;
  font-style: italic;
  font-family: 'Literata', Georgia, serif;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.hair-rule {
  width: 3rem;
  height: 1px;
  background: var(--ink);
  opacity: 0.3;
  border: 0;
  margin: 0;
}

.section-divider {
  width: 100%;
  height: 1px;
  background: var(--rule-soft);
  border: 0;
  margin: 2rem 0;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 2rem 0 1rem 0;
}

.section-heading h2 {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 0;
  color: var(--char);
  letter-spacing: -0.005em;
}

.section-heading .section-number {
  font-family: 'Literata', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--gold);
  min-width: 2.5rem;
}

/* ============================================================
   CHECKBOXES
   ============================================================ */

.checkbox-group {
  margin: 1rem 0 1.5rem 0;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.35rem 0;
  line-height: 1.5;
  font-size: 0.95rem;
  color: var(--ink);
}

.checkbox-item::before {
  content: "";
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  border: 1.25px solid var(--ink);
  border-radius: 2px;
  margin-top: 0.22rem;
  background: var(--paper);
}

.checkbox-item.nested {
  margin-left: 1.5rem;
}

/* ============================================================
   CATEGORY BLOCKS (groups of checkboxes with a label)
   ============================================================ */

.category-block {
  margin: 1.5rem 0 1.5rem 0;
  break-inside: avoid;
}

.category-block .category-label {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--char);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule-soft);
}

/* ============================================================
   WRITE-IN FIELDS (blanks for pen responses)
   ============================================================ */

.write-line {
  border: 0;
  border-bottom: 1px solid var(--rule);
  margin: 1.4rem 0;
  height: 0;
}

.write-line.short {
  display: inline-block;
  width: 14rem;
  vertical-align: bottom;
  margin: 0 0.5rem;
}

.write-line.medium {
  display: inline-block;
  width: 20rem;
  vertical-align: bottom;
  margin: 0 0.5rem;
}

.write-block {
  margin: 1rem 0 1.5rem 0;
}

.write-block .prompt {
  font-family: 'Literata', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

.write-block .lines {
  margin-top: 0.75rem;
}

.write-block .lines .write-line {
  margin: 1.5rem 0;
}

.write-block.lines-2 .lines .write-line { margin: 1.5rem 0; }
.write-block.lines-3 .lines .write-line:nth-child(-n+3) { display: block; }
.write-block.lines-4 .lines .write-line:nth-child(-n+4) { display: block; }

.field-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 1.4rem 0;
}

.field-row .field-label {
  min-width: 12rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--char);
  letter-spacing: 0.02em;
}

.field-row .field-value {
  flex: 1;
  border: 0;
  border-bottom: 1px solid var(--rule);
  height: 1.5rem;
}

/* ============================================================
   TOTAL / SCORE BLOCKS
   ============================================================ */

.total-block {
  background: var(--bone);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.total-block .total-label {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--char);
}

.total-block .total-value {
  border: 0;
  border-bottom: 2px solid var(--char);
  width: 4rem;
  height: 1.8rem;
  background: transparent;
  display: inline-block;
}

/* ============================================================
   INSTRUCTION BOXES
   ============================================================ */

.instruction-box {
  background: var(--linen);
  border-left: 3px solid var(--gold);
  padding: 1.1rem 1.4rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  break-inside: avoid;
}

.instruction-box.muted {
  background: var(--bone);
  border-left-color: var(--ink-soft);
}

.instruction-box p {
  margin: 0;
}

.instruction-box p + p {
  margin-top: 0.6rem;
}

.instruction-box .italic-serif {
  font-size: 1rem;
}

/* ============================================================
   PATTERN CARDS (for pattern descriptions on self-assessment)
   ============================================================ */

.pattern-card {
  padding: 1.5rem 0;
  break-inside: avoid;
}

.pattern-card + .pattern-card {
  border-top: 1px solid var(--rule-soft);
  margin-top: 0.5rem;
}

.pattern-card .pattern-number {
  font-family: 'Literata', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.pattern-card .pattern-name {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--char);
  margin: 0.15rem 0 1rem 0;
  letter-spacing: -0.005em;
}

/* ============================================================
   TABLES (tracking grids)
   ============================================================ */

.tracking-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.82rem;
}

.tracking-table th,
.tracking-table td {
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.4rem;
  text-align: left;
  font-weight: 400;
  color: var(--ink);
  vertical-align: middle;
}

.tracking-table th {
  border-bottom: 1px solid var(--ink);
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--char);
  padding-bottom: 0.65rem;
}

.tracking-table td.day-number {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  color: var(--gold);
  width: 2.5rem;
  text-align: center;
}

.tracking-table tbody tr {
  height: 2.2rem;
}

/* ============================================================
   STOP FEEDING THE SYSTEM WORKSHEETS
   ============================================================ */

.manos-worksheet .worksheet-title-block {
  margin-bottom: 1.75rem;
}

.manos-worksheet .body-sm {
  color: var(--ink);
}

.manos-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
  margin: 1.25rem 0 1.75rem;
}

.manos-two-columns > section {
  break-inside: avoid;
}

.manos-grid th,
.manos-grid td {
  border: 1px solid var(--rule);
}

.manos-grid tbody tr {
  height: 3.2rem;
}

.pattern-ledger-grid th {
  font-size: 0.58rem;
  line-height: 1.25;
  padding: 0.45rem 0.35rem;
}

.pattern-ledger-grid td {
  padding: 0.45rem;
}

.manos-field {
  break-inside: avoid;
}

.manos-card-list,
.manos-rung,
.manos-principle,
.manos-country {
  break-inside: avoid;
}

.manos-check-card {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rule-soft);
}

.manos-check-card .section-heading,
.manos-rung .section-heading {
  margin: 1rem 0 0.5rem;
}

.diagnostic-columns {
  gap: 1rem;
}

.diagnostic-block {
  border-top: 1px solid var(--rule-soft);
  padding-top: 0.65rem;
  margin-top: 0.65rem;
}

.diagnostic-block h3,
.manos-country h2,
.manos-principle h2 {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  color: var(--char);
  margin: 0 0 0.35rem;
}

.diagnostic-block p,
.manos-country p,
.manos-principle p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.65rem;
}

/* ============================================================
   LINE MARK (brand: the gold line from the cover)
   ============================================================ */

.line-mark {
  display: inline-block;
  width: 12px;
  height: 22px;
}

.line-mark svg {
  width: 100%;
  height: 100%;
  fill: var(--gold);
}

/* ============================================================
   BOTANICAL MARK (small accent)
   ============================================================ */

.botanical-mark {
  display: inline-block;
  width: 20px;
  height: 20px;
  color: var(--char);
}

.botanical-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.section-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.5rem 0;
}

.section-ornament svg {
  width: 28px;
  height: 28px;
  stroke: var(--gold);
  stroke-width: 1.1;
  fill: none;
  opacity: 0.6;
}

/* ============================================================
   PATTERN PLAN BLOCKS (for foundations-plan worksheet)
   ============================================================ */

.pattern-plan {
  break-inside: avoid;
  margin: 1.75rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule-soft);
}
.pattern-plan:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.pattern-plan h3 {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--char);
  margin: 0 0 1rem 0;
  letter-spacing: -0.005em;
}
.pattern-plan h3 .pattern-tag {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.3rem;
}
.priority-group {
  margin: 1rem 0;
}
.priority-label {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--char);
  margin: 1rem 0 0.5rem 0;
}
.priority-group ol {
  margin: 0.5rem 0 0 0;
  padding-left: 1.5rem;
  line-height: 1.7;
  font-size: 0.92rem;
}
.priority-group ol li {
  padding: 0.2rem 0;
  color: var(--ink);
}
.priority-group ol li strong {
  font-weight: 600;
  color: var(--char);
}
.avoid-block {
  background: var(--bone);
  padding: 0.85rem 1.1rem;
  margin-top: 0.9rem;
  border-radius: 3px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
}
.avoid-block .avoid-label {
  font-weight: 600;
  color: var(--char);
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

/* ============================================================
   PHASE BLOCKS (for ninety-day-plan worksheet)
   ============================================================ */

.phase-block {
  break-inside: avoid;
  margin: 2rem 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule-soft);
}
.phase-block:first-of-type {
  border-top: 0;
  padding-top: 0.5rem;
}
.phase-header {
  margin-bottom: 1rem;
}
.phase-eyebrow {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.phase-title {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--char);
  margin: 0;
  line-height: 1.2;
}
.week-item {
  margin: 1rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--rule-soft);
}
.week-label {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--char);
  margin-bottom: 0.3rem;
}
.week-prompt {
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
  line-height: 1.55;
}
.week-field {
  border: 0;
  border-bottom: 1px solid var(--rule);
  height: 1.3rem;
  margin: 0.6rem 0;
}

/* ============================================================
   CYCLE LOG OVERRIDES (for cycle-log worksheet)
   ============================================================ */

.cycle-log .tracking-table {
  font-size: 0.78rem;
}
.cycle-log .tracking-table th {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.3rem 0.5rem 0.3rem;
}
.cycle-log .tracking-table td {
  padding: 0.45rem 0.3rem;
  height: 1.9rem;
  min-width: 0;
}
.cycle-log .tracking-table td.day-number {
  width: 1.8rem;
  font-size: 0.85rem;
}
.cycle-log .tracking-table col.col-day { width: 3rem; }
.cycle-log .tracking-table col.col-cycle { width: 3.5rem; }
.cycle-log .tracking-table col.col-bleed { width: 3rem; }
.cycle-log .tracking-table col.col-sleep-hrs { width: 3rem; }
.cycle-log .tracking-table col.col-sleep-q { width: 3.5rem; }
.cycle-log .tracking-table col.col-mood { width: 3rem; }
.cycle-log .tracking-table col.col-energy { width: 3rem; }

.cycle-log .tracking-table.cycle-grid tbody tr {
  height: 1.45rem;
}
.cycle-log .tracking-table.cycle-grid th {
  padding: 0.25rem 0.25rem 0.4rem 0.25rem;
}
.cycle-log .tracking-table.cycle-grid td {
  height: 1.45rem;
  padding: 0.22rem 0.25rem;
}
.cycle-log .tracking-table.cycle-grid col.col-1 { width: 2.3rem; }
.cycle-log .tracking-table.cycle-grid col.col-2 { width: 3.4rem; }
.cycle-log .tracking-table.cycle-grid col.col-3 { width: 5rem; }
.cycle-log .tracking-table.cycle-grid col.col-4 { width: 5rem; }
.cycle-log .tracking-table.cycle-grid col.col-5 { width: 5rem; }

.cycle-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.cycle-fields .field-row {
  margin: 0;
}

.symptoms-block {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bone);
  border-radius: 3px;
}
.symptoms-block .cat-label {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--char);
  margin-bottom: 0.5rem;
}
.symptoms-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.symptoms-inline .checkbox-item {
  font-size: 0.82rem;
  padding: 0.15rem 0;
}
.symptoms-inline .checkbox-item::before {
  width: 0.9rem;
  height: 0.9rem;
  margin-top: 0.2rem;
}

/* ============================================================
   RED FLAGS (for red-flags worksheet)
   ============================================================ */

.red-flag-category {
  margin: 1.5rem 0;
  break-inside: avoid;
}
.red-flag-category h3 {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--char);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.005em;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule-soft);
}
.red-flag-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
}
.red-flag-list li {
  padding: 0.35rem 0 0.35rem 1.25rem;
  position: relative;
  color: var(--ink);
}
.red-flag-list li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.75rem;
  width: 0.35rem;
  height: 0.35rem;
  background: var(--gold);
  border-radius: 50%;
}
.escalation-banner {
  background: var(--char);
  color: var(--paper);
  padding: 1.75rem 2rem;
  margin: 2rem 0;
  text-align: center;
  break-inside: avoid;
}
.escalation-banner h2 {
  font-family: 'Literata', Georgia, serif;
  font-weight: 300;
  font-size: 1.6rem;
  line-height: 1.15;
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.01em;
}
.escalation-banner p {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  opacity: 0.9;
}
.fridge-instruction {
  text-align: center;
  font-style: italic;
  font-family: 'Literata', Georgia, serif;
  font-weight: 300;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 1.5rem;
  padding: 0.75rem 0;
}

/* ============================================================
   TWO-COLUMN BLOCKS (for compact layouts)
   ============================================================ */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1rem 0;
}

@media (max-width: 640px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   WEB-ONLY CHROME (hidden when printing)
   ============================================================ */

.web-chrome {
  max-width: 210mm;
  margin: 0 auto;
  padding: 2rem 1.5rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.web-chrome a {
  color: var(--char);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}

.web-chrome a:hover {
  border-bottom-color: var(--char);
}

.web-cta-block {
  max-width: 210mm;
  margin: 0 auto 4rem auto;
  padding: 2.5rem 2rem;
  background: var(--char);
  color: var(--paper);
  border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 640px) {
  .web-cta-block {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

.web-cta-block h3 {
  font-family: 'Literata', Georgia, serif;
  font-weight: 300;
  font-size: 1.65rem;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}

.web-cta-block p {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0;
  max-width: 32rem;
  line-height: 1.5;
}

.web-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  background: var(--paper);
  color: var(--char);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.25s ease;
  white-space: nowrap;
}

.web-cta-btn:hover {
  background: var(--brass);
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@page {
  size: A4;
  margin: 15mm;
}

@media print {
  /* PAGINATION CONTRACT (applies to every worksheet, incl. new ones):
     each <article class="page …"> must fit exactly ONE A4 sheet.
     Content budget ≈ 267mm (297mm − 2×15mm @page margins) ≈ 1009 CSS px,
     including the brand header and the in-flow page footer. When a tool
     runs long, split it into more articles at a section boundary
     (repeat brand_header + a "Tool NN · Continued" title block, keep
     "Page N of M" footers accurate) rather than letting content flow —
     and keep the `pages:` value in db/seeds/manos.yml in sync.
     Never put content in a CSS grid that must break across sheets:
     grids cannot fragment in Chrome print (see .manos-two-columns
     below, which is converted to multicol for print). */
  body, .worksheet-shell {
    background: white;
    font-size: 10.5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .web-chrome,
  .web-cta-block,
  .no-print {
    display: none !important;
  }

  body { margin: 0; }

  .worksheet-shell { padding: 0; }

  .page {
    max-width: none;
    width: 100%;
    /* articles flow naturally; the break lands between articles and
       the footer follows each article's content */
    min-height: auto;
    height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: white;
    page-break-after: always;
  }

  .page:last-child {
    page-break-after: auto;
  }

  .page + .page {
    margin-top: 0;
  }

  .page-footer {
    position: static;
    margin-top: 5mm;
    padding-top: 0.5rem;
  }

  /* CSS grids cannot fragment across printed sheets in Chrome: an
     over-tall grid is pushed whole onto the next sheet and its columns
     then interleave badly. Print swaps the two-column grids to CSS
     multicol — the same two-column look, but the content can flow.
     Screen keeps the grid (rules above are untouched). */
  .manos-two-columns {
    display: block;
    columns: 2;
    column-gap: 1.5rem;
    margin: 1rem 0 1.25rem;
  }

  .manos-two-columns.diagnostic-columns {
    column-gap: 1rem;
  }

  .manos-two-columns > section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* In multicol the second column loses its leading margin, so direct
     field-row children sit misaligned. Zero the top margin on both. */
  .manos-two-columns > .field-row {
    margin-top: 0;
    margin-bottom: 0.75rem;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .checkbox-item::before {
    border-color: #000;
  }

  /* Densify the vertical rhythm on paper: keep the write-space, trim
     the air between blocks so declared page counts hold. */
  .worksheet-title-block { margin-bottom: 1.25rem; }
  .worksheet-title-block .worksheet-intro { margin-top: 0.5rem; font-size: 0.95rem; }
  .section-heading { margin: 0.85rem 0 0.45rem 0; }
  .checkbox-item { padding: 0.15rem 0; font-size: 0.9rem; line-height: 1.4; }
  .checkbox-group { margin: 0.6rem 0 1rem 0; }
  .category-block { margin: 0.75rem 0; }
  .write-line { margin: 1.15rem 0; }
  .write-block .lines .write-line { margin: 1.15rem 0; }
  .write-block { margin: 0.7rem 0 1rem 0; }
  .field-row { margin: 0.5rem 0; }
  .caption { margin-block: 0.5em; }
  .instruction-box { padding: 0.75rem 1.1rem; margin: 0.9rem 0; }
  .avoid-block { padding: 0.7rem 1rem; margin-top: 0.75rem; }
  .total-block { padding: 0.9rem 1.25rem; margin: 1rem 0; }
  .body-sm, .body { margin-block: 0.35em; }
  .tracking-table th, .tracking-table td { padding: 0.35rem 0.4rem; }
  .manos-grid tbody tr { height: 2.8rem; }
  .phase-block { margin: 0.75rem 0; padding: 0.75rem 0; }
  .phase-header { margin-bottom: 0.5rem; }
  .phase-title { font-size: 1.25rem; }
  .diagnostic-block { margin-bottom: 0.6rem; padding-top: 0.5rem; margin-top: 0.5rem; }
  .week-item { margin: 0.75rem 0; }
  /* Tool-scoped print shaves. Each tool's articles must land on exactly
     one A4 sheet (267mm of content incl. footer); these buy the last
     few millimetres where a sheet runs tight. Measured against the
     print layout — see git history for the pagination pass. */
  .the-dashboard .tracking-table { margin: 0.9rem 0; }
  .the-dashboard .tracking-table th,
  .the-dashboard .tracking-table td { padding: 0.16rem 0.4rem; }
  .the-dashboard .worksheet-title-block { margin-bottom: 0.5rem; }
  .the-dashboard .section-heading { margin: 0.55rem 0 0.3rem 0; }
  .the-dashboard .body-sm { margin-block: 0.25em; }
  .dashboard-check-grid tbody tr { height: 1.5rem; }
  .the-dashboard .display-l { font-size: 15pt; }

  .coherence-grid tbody tr { height: 2rem; }

  .reboot-grid tbody tr { height: 2.2rem; }
  .reboot-tracker .week-item { margin: 0.5rem 0; }
  .reboot-tracker .week-prompt { margin-bottom: 0.4rem; }
  .reboot-tracker .week-field { height: 1.1rem; margin: 0.35rem 0; }
  .reboot-tracker .worksheet-title-block { margin-bottom: 1rem; }
  .reboot-tracker .section-heading { margin: 0.7rem 0 0.4rem 0; }
  .reboot-tracker .instruction-box { padding: 0.6rem 1rem; margin: 0.7rem 0; }
  .reboot-tracker .checkbox-item { padding: 0.1rem 0; }

  .clean-money-protocol .priority-group ol { line-height: 1.55; }
  .clean-money-protocol .priority-group ol li { padding: 0.1rem 0; }
  .clean-money-protocol .phase-block { margin: 0.5rem 0; padding: 0.5rem 0; }
  .clean-money-protocol .phase-header { margin-bottom: 0.35rem; }
  .clean-money-protocol .checkbox-item { padding: 0.1rem 0; }
  .clean-money-protocol .worksheet-title-block { margin-bottom: 1rem; }
  .clean-money-protocol .body-sm { margin-block: 0.3em; }
  .clean-money-protocol .field-row { margin: 0.45rem 0; }

  .body-maintenance .checkbox-item { padding: 0.1rem 0; }
  .body-maintenance .checkbox-group { margin: 0.4rem 0 0.6rem 0; }
  .body-maintenance .category-block { margin: 0.6rem 0; }
  .body-maintenance .category-block .category-label { margin-bottom: 0.4rem; }
  .body-maintenance .category-block .body-sm { margin-block: 0.25em; }
  .body-maintenance .worksheet-title-block { margin-bottom: 0.75rem; }
  .body-maintenance .section-heading { margin: 0.7rem 0 0.4rem 0; }
  .body-maintenance .body-sm { margin-block: 0.25em; }
  .body-maintenance .display-l { font-size: 15pt; }
  .body-maintenance .manos-two-columns { margin: 0.6rem 0 0.9rem; }
  .results-table th,
  .results-table td { padding: 0.16rem 0.4rem; }
  .results-table tbody tr { height: 1.8rem; }

  .values-diagnostic .checkbox-item { padding: 0.08rem 0; line-height: 1.35; }
  .values-diagnostic .write-line,
  .values-diagnostic .write-block .lines .write-line { margin: 1rem 0; }
  .section-divider { margin: 1.25rem 0; }

  /* Table Starter: six diagnostic blocks + the RPM close share sheet 1. */
  .table-starter .diagnostic-block { margin-bottom: 0.35rem; padding-top: 0.35rem; margin-top: 0.35rem; }
  .table-starter .worksheet-title-block { margin-bottom: 1rem; }
  .table-starter .section-heading { margin: 0.6rem 0 0.35rem 0; }
  .table-starter .body-sm { margin-block: 0.3em; }

  /* When Life Hits Hard: three phase groups per sheet, plus the red
     flags on sheet 3 — the checklists carry the density. */
  .when-life-hits-hard .category-block { margin: 0.5rem 0; }
  .when-life-hits-hard .category-block .category-label { margin-bottom: 0.35rem; padding-bottom: 0.25rem; }
  .when-life-hits-hard .checkbox-group { margin: 0.25rem 0 0.4rem 0; }
  .when-life-hits-hard .checkbox-item { padding: 0.06rem 0; line-height: 1.35; }
  .when-life-hits-hard .worksheet-title-block { margin-bottom: 0.9rem; }
  .when-life-hits-hard .section-heading { margin: 0.55rem 0 0.3rem 0; }
  .when-life-hits-hard .body-sm { margin-block: 0.25em; }

  .display-xxl { font-size: 28pt; }
  .display-xl { font-size: 22pt; }
  .display-l { font-size: 16pt; }
  .display-m { font-size: 13pt; }

  .section-heading h2 { font-size: 14pt; }

  /* Prevent breaks inside small atoms only. Large containers
     (category-block, priority-group, phase-block) must fragment or
     they widow onto half-empty sheets. */
  .checkbox-item,
  .field-row,
  .write-block,
  .week-item,
  .diagnostic-block,
  .pattern-card,
  .instruction-box,
  .total-block,
  .section-heading {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .section-heading {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Hide URLs after links when printing */
  a[href]::after {
    content: "";
  }

  .escalation-banner {
    background: var(--char) !important;
    color: var(--paper) !important;
  }
}
