.resource-main {
  padding-block: clamp(42px, 7vw, 90px) clamp(56px, 7vw, 86px);
}
.resource-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-bottom: 34px;
}
.resource-hero h1 {
  max-width: 18ch;
  font-size: clamp(2.75rem, 6.5vw, 5rem);
  text-wrap: balance;
}
.resource-hero p {
  max-width: 59ch;
  margin-top: 15px;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
}
.resource-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.count-sheet, .worked-example, .balance-tool {
  padding: clamp(16px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 8px 22px #30274a0a;
}
.balance-tool {
  margin-bottom: 24px;
}
.balance-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.balance-fields label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}
.balance-fields input {
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.balance-tool output {
  font-weight: 700;
}
.balance-tool output[data-error] {
  color: #922531;
}
.sheet-heading h2, .resource-prose h2, .resource-next h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  text-wrap: balance;
}
.sheet-heading p, .resource-next p {
  margin-top: 9px;
  color: var(--muted);
}
.sheet-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 26px;
  margin: 20px 0;
}
.sheet-fields > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 6px;
}
.sheet-fields dt, .sheet-notes strong {
  font-weight: 700;
}
.sheet-fields dd {
  margin: 0;
}
.write-line {
  display: block;
  min-height: 1.3rem;
  border-bottom: 1px solid #b9b5c6;
}
.resource-table-wrap {
  overflow-x: auto;
}
.resource-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: .92rem;
  text-align: left;
}
.resource-table caption {
  padding: 0 0 7px;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}
.resource-table :is(th, td) {
  padding: 8px 10px;
  border: 1px solid #dcd7e5;
}
.resource-table thead {
  background: #f0ecfa;
}
.sheet-table td {
  height: 32px;
}
.sheet-rule {
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: .9rem;
}
.sheet-notes {
  margin-top: 10px;
}
.sheet-notes .write-line {
  min-height: 1.7rem;
}
.worked-table :is(th, td):not(:first-child) {
  text-align: right;
}
.worked-example .resource-table-wrap, .worked-example > p {
  margin-top: 17px;
}
.resource-prose {
  max-width: 72ch;
  padding-block: 35px;
}
.resource-prose > section + section {
  margin-top: 32px;
}
.resource-prose :is(p, ol, blockquote) {
  margin: 12px 0;
}
.resource-prose ol {
  padding-inline-start: 23px;
}
.resource-prose li + li {
  margin-top: .65em;
}
.resource-prose a {
  color: var(--purple-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.resource-prose blockquote {
  border-inline-start: 4px solid var(--purple);
  padding: 11px 15px;
  background: #f0ecfa;
}
.resource-next {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: clamp(16px, 4vw, 36px);
  border: 1px solid #d5e8dd;
  border-radius: 18px;
  background: var(--mint);
}
@media (max-width: 850px) {
  .resource-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
@media (max-width: 520px) {
  .balance-fields {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .resource-page .masthead {
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 11px;
  }
  .resource-page .masthead nav {
    gap: 11px;
  }
  .sheet-fields {
    grid-template-columns: 1fr;
  }
}
@media print {
  .count-sheet-page, .count-sheet-page .count-sheet {
    color: #000;
    background: white;
  }
  .count-sheet-page .resource-chrome {
    display: none !important;
  }
  .count-sheet-page .resource-main {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .count-sheet-page .count-sheet {
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  .count-sheet-page .resource-table-wrap {
    overflow: visible;
  }
  .count-sheet-page .resource-table {
    min-width: 0;
    font-size: 10pt;
  }
  .count-sheet-page .resource-table th, .count-sheet-page .resource-table td {
    border-color: #777;
  }
  .count-sheet-page .resource-table td {
    height: 24px;
  }
  .count-sheet-page .sheet-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .count-sheet-page .sheet-rule, .count-sheet-page .sheet-heading p {
    color: #000;
  }
  .count-sheet-page .count-sheet tr {
    break-inside: avoid;
  }
}
