/* Section rework: #after. Every selector is scoped under #after. */

/* The lead sits under the title; the first block follows without a rule. */
#after .lead + .blk {
  margin-top: var(--stack-4);
  padding-top: 0;
  border-top: 0;
}

/* Support and Later: a ledger, label left and text right on a wide screen. */
#after .terms-rows dd {
  max-width: 34rem;
}
#after .terms-rows > div:last-child {
  padding-bottom: 0;
}
#after .after-fine {
  margin-top: var(--stack-3);
  max-width: 34rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--deep-soft);
}
#after .after-fine strong,
#after .after-free strong {
  font-weight: 500;
  color: var(--ink);
}

/* Short text above Care's plans and above the cost table. */
#after .after-lede {
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--deep-soft);
}
#after .after-free {
  margin-top: var(--stack-2);
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--deep-soft);
}

/* Care: two plans in the detail column. The optional price stays below the offer prices. */
#after .after-lede + .care-plans {
  margin-top: var(--stack-3);
}
#after .care-plan .offer-price {
  margin-top: 0.25rem;
  font-size: 2rem;
  line-height: 1.1;
}
#after .care-terms {
  font-weight: 500;
  color: var(--ink);
}

/* Costs: the table spans both columns; one vendor per line. */
#after .costs-wrap {
  min-width: 0;
  margin-top: var(--stack-2);
}
#after .costs .v {
  display: block;
}
#after .costs .v + .v {
  margin-top: 0.25rem;
}
#after .costs-wrap .table-note {
  max-width: 40rem;
}

@media (min-width: 900px) {
  #after .costs-wrap {
    grid-column: 1 / -1;
  }
  #after .terms-rows > div {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 5fr);
    gap: var(--stack-3);
    align-items: baseline;
  }
  #after .terms-rows dd {
    margin-top: 0;
  }
}

/* Phone: each cost row is the name, then "Free" and "Can cost" as short labels beside the text. */
@media screen and (max-width: 899px) {
  #after .costs tr {
    gap: 0.5rem;
    padding-block: 1rem;
  }
  #after .costs td {
    position: relative;
    padding: 0 0 0 5.25rem;
    font-size: 0.9375rem;
    line-height: 1.5rem;
  }
  #after .costs td::before {
    content: attr(data-label);
    position: absolute;
    top: 0;
    left: 0;
    width: 4.5rem;
    font-size: 0.875rem;
    line-height: 1.5rem;
    font-weight: 500;
    color: var(--ink);
  }
}

/* PDF: same two-column layout as the wide screen, and no row or plan split across pages. */
@media print {
  #after .blk {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
  #after .costs-wrap {
    grid-column: 1 / -1;
  }
  #after .terms-rows > div {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 5fr);
    gap: var(--stack-3);
    align-items: baseline;
    break-inside: avoid;
  }
  #after .terms-rows dd {
    margin-top: 0;
  }
  #after .care-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    row-gap: 0;
  }
  #after .care-plan {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    break-inside: avoid;
  }
  #after .costs tr,
  #after .table-note {
    break-inside: avoid;
  }
}
