/* InvoicePress
   The look borrows from a duplicate invoice book: a white top sheet with
   yellow and pink copies under it, carbon-blue ink and a red serial number. */

:root {
  color-scheme: light;
  --desk: #e9edf4;
  --panel: #ffffff;
  --well: #f4f6fa;
  --ink: #141a2e;
  --ink-2: #4a5370;
  --line: #d3d9e6;
  --accent: #1d3a8f;
  --on-accent: #ffffff;
  --red: #b92d18;
  --green: #1a6f4f;
  --copy-yellow: #f4dc6b;
  --copy-pink: #f3b8c4;
  --chip-unpaid: #fbe9ee;
  --chip-paid: #e2f3ea;
  --paper: #ffffff;
  --shadow: 0 1px 2px rgba(20, 26, 46, 0.08), 0 12px 32px -12px rgba(20, 26, 46, 0.28);
  --serif: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, 'Noto Serif', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --desk: #0e1424;
    --panel: #172038;
    --well: #111a30;
    --ink: #e8ecf7;
    --ink-2: #a6b0cb;
    --line: #2d3959;
    --accent: #9db2ff;
    --on-accent: #0e1424;
    --red: #ff8f7a;
    --green: #6ad3a6;
    --chip-unpaid: #3a2230;
    --chip-paid: #173328;
    --paper: #f3f4f7;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 36px -14px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --desk: #0e1424;
  --panel: #172038;
  --well: #111a30;
  --ink: #e8ecf7;
  --ink-2: #a6b0cb;
  --line: #2d3959;
  --accent: #9db2ff;
  --on-accent: #0e1424;
  --red: #ff8f7a;
  --green: #6ad3a6;
  --chip-unpaid: #3a2230;
  --chip-paid: #173328;
  --paper: #f3f4f7;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 36px -14px rgba(0, 0, 0, 0.7);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 16px;
}
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img,
svg {
  max-width: 100%;
}
a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
[hidden] {
  display: none !important;
}
.wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 50;
  background: var(--panel);
  padding: 8px 12px;
}

/* ---------- header ---------- */
.site-head {
  padding-top: env(safe-area-inset-top, 0px);
}
.head-row {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  padding-block: 14px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 700 1.25rem/1 var(--serif);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.mark {
  flex: none;
}
.main-nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 2px;
}
.main-nav a:hover {
  text-decoration: underline;
}
.badge {
  display: inline-block;
  min-width: 1.5em;
  margin-left: 6px;
  padding: 0 0.4em;
  border-radius: 99px;
  background: var(--red);
  color: var(--panel);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.theme-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.i-sun {
  display: none;
}
:root[data-theme='dark'] .i-sun {
  display: block;
}
:root[data-theme='dark'] .i-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .i-sun {
    display: block;
  }
  :root:not([data-theme='light']) .i-moon {
    display: none;
  }
}
@media (max-width: 560px) {
  .brand {
    order: 1;
  }
  .theme-btn {
    order: 2;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
}

/* ---------- page intro ---------- */
.intro {
  padding-block: clamp(12px, 3vw, 32px) clamp(18px, 3vw, 30px);
}
.intro h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.02;
  max-width: 18ch;
}
.intro p {
  max-width: 58ch;
  margin: 14px 0 0;
  font-size: 1.125rem;
  color: var(--ink-2);
}
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.crumbs li + li::before {
  content: '/';
  margin-inline: 8px;
  color: var(--line);
}
.crumbs a {
  color: var(--ink-2);
}

/* ---------- buttons and fields ---------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink);
  font: 600 0.95rem/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--ink-2);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  filter: brightness(1.12);
  border-color: var(--accent);
}
.btn-text {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  padding-inline: 8px;
}
.btn-small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.85rem;
}
.btn-danger {
  color: var(--red);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--red);
  background: var(--well);
}
.f {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.f > span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.f em {
  font-style: normal;
  font-weight: 400;
  opacity: 0.8;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--well);
  color: var(--ink);
  font: 400 1rem/1.35 var(--sans);
}
textarea {
  resize: vertical;
  display: block;
}
input::placeholder,
textarea::placeholder {
  color: var(--ink-2);
  opacity: 0.65;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
  background: var(--panel);
}
[aria-invalid='true'] {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
input[type='checkbox'] {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-block: 8px;
  cursor: pointer;
}
.check small {
  display: block;
  color: var(--ink-2);
  font-size: 0.85rem;
}
.help {
  margin: 6px 0;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.grid .wide {
  grid-column: 1 / -1;
}
@media (max-width: 420px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- the tool ---------- */
.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sec {
  padding: 20px clamp(16px, 2.4vw, 24px) 22px;
  border-bottom: 1px solid var(--line);
}
.sec:last-child {
  border-bottom: 0;
}
.sec h2 {
  font-size: 1.2rem;
  margin-bottom: 14px;
}
details.sec > summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
details.sec > summary::-webkit-details-marker {
  display: none;
}
details.sec > summary::after {
  content: 'Edit';
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}
details.sec[open] > summary::after {
  content: 'Hide';
}
details.sec:not([open]) > summary h2 {
  margin-bottom: 0;
}
.sec-sum {
  color: var(--ink-2);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
details.sec[open] .sec-sum {
  display: none;
}
.more {
  margin-top: 14px;
}
.more summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  width: fit-content;
  padding-block: 6px;
}
.more .grid {
  margin-top: 10px;
}
.sub {
  margin: 4px 0 12px 30px;
}
.logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.logo-row img {
  height: 44px;
  max-width: 120px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

/* items: description on one row, numbers on the next */
.items {
  min-height: 120px;
}
.item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr) 40px;
  gap: 8px 10px;
  align-items: end;
  padding: 14px 0;
  border-top: 1px dashed var(--line);
}
.item:first-child {
  border-top: 0;
  padding-top: 0;
}
.item-desc {
  grid-column: 1 / 4;
  grid-row: 1;
}
.item .icon-btn {
  grid-column: 4;
  grid-row: 1;
}
.item-qty {
  grid-column: 1;
  grid-row: 2;
}
.item-rate {
  grid-column: 2;
  grid-row: 2;
}
.item-amt {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: right;
  min-width: 0;
}
.item-amt > span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.item-amt output {
  display: block;
  padding: 11px 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item textarea {
  resize: none;
  overflow: hidden;
}
.item-qty input,
.item-rate input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cis-only {
  display: none;
}
.cis-on .cis-only {
  display: flex;
}
.item-type {
  grid-column: 1 / 4;
  grid-row: 3;
}
@media (min-width: 641px) {
  .cis-on .item {
    grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr) 40px;
  }
  .cis-on .item-desc {
    grid-column: 1 / 5;
  }
  .cis-on .item .icon-btn {
    grid-column: 5;
  }
  .cis-on .item-type {
    grid-column: 3;
    grid-row: 2;
  }
  .cis-on .item-amt {
    grid-column: 4;
  }
}

/* preview column */
.preview {
  position: sticky;
  top: 16px;
}
.preview-top {
  display: none;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.actions .btn-primary {
  flex: 1 1 auto;
}
.err {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--red);
  background: var(--chip-unpaid);
  border-radius: 0 var(--r) var(--r) 0;
  font-weight: 600;
}
.hint {
  margin: 14px 0 0;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.stack {
  position: relative;
  isolation: isolate;
  margin-inline: 6px;
}
.stack::before,
.stack::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 2px;
}
.stack::before {
  background: var(--copy-pink);
  transform: rotate(1.3deg) translate(5px, 4px);
}
.stack::after {
  background: var(--copy-yellow);
  transform: rotate(-0.8deg) translate(-3px, 3px);
}
.paper-box {
  container-type: inline-size;
  box-shadow: var(--shadow);
  border-radius: 2px;
}

/* The sheet itself. --u is one millimetre at the current size, so the
   preview keeps the proportions of the printed page at any width. */
.paper {
  --u: calc(100cqw / 210);
  --p-ink: #141a2e;
  --p-grey: #616b85;
  --p-blue: #1d3a8f;
  --p-red: #c4321c;
  --p-rule: #d6dbe8;
  --p-tint: #edf1f9;
  min-height: calc(100cqw * 1.4142);
  padding: calc(var(--u) * 18);
  background: var(--paper);
  color: var(--p-ink);
  font: 400 calc(var(--u) * 3.2) / 1.38 Helvetica, Arial, sans-serif;
  border-radius: 2px;
  overflow-wrap: anywhere;
}
.paper.letter {
  --u: calc(100cqw / 216);
  min-height: calc(100cqw * 1.2941);
}
.paper .ghost {
  color: #a9b0c3;
}
.p-head,
.p-mid {
  display: flex;
  justify-content: space-between;
  gap: 1.5em;
}
.p-from {
  max-width: 54%;
}
.p-from img {
  display: block;
  max-width: calc(var(--u) * 53);
  max-height: calc(var(--u) * 19);
  margin-bottom: 1em;
}
.p-name {
  font-size: 1.42em;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.2em;
}
.p-lines {
  color: var(--p-grey);
}
.p-title {
  text-align: right;
}
.p-word {
  font-size: 2.4em;
  font-weight: 700;
  line-height: 1.05;
  color: var(--p-blue);
  text-transform: uppercase;
}
.p-no {
  margin-top: 0.3em;
  font-size: 1.2em;
  font-weight: 700;
  color: var(--p-red);
}
.p-mid {
  margin-top: 2.6em;
}
.p-label {
  font-size: 0.86em;
  font-weight: 700;
  color: var(--p-grey);
  margin-bottom: 0.35em;
}
.p-client {
  font-size: 1.2em;
  font-weight: 700;
}
.p-meta {
  margin: 0;
  min-width: 38%;
}
.p-meta div {
  display: flex;
  justify-content: space-between;
  gap: 1.5em;
  padding-bottom: 0.4em;
}
.p-meta dt {
  color: var(--p-grey);
}
.p-meta dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}
.p-items {
  width: 100%;
  margin-top: 2em;
  border-collapse: collapse;
  font-size: 1.04em;
}
.p-items th {
  background: var(--p-tint);
  color: var(--p-blue);
  font-size: 0.84em;
  text-align: right;
  padding: 0.7em 0.9em;
  white-space: nowrap;
}
.p-items td {
  padding: 0.8em 0.9em;
  text-align: right;
  vertical-align: top;
  border-bottom: 1px solid var(--p-rule);
  white-space: nowrap;
}
.p-items th:first-child,
.p-items td:first-child {
  text-align: left;
  white-space: normal;
  width: 56%;
}
.p-items small {
  display: block;
  font-size: 0.78em;
  color: var(--p-grey);
}
.p-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  margin-top: 1em;
}
.p-totals {
  width: 47%;
  min-width: 15em;
  font-size: 1.04em;
}
.p-row {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  padding: 0.38em 0.9em;
  color: var(--p-grey);
}
.p-row span:last-child {
  color: var(--p-ink);
  white-space: nowrap;
}
.p-grand,
.p-grand span:last-child {
  color: var(--p-ink);
  font-weight: 700;
}
.p-due {
  margin-top: 0.4em;
  padding-block: 0.6em;
  background: var(--p-tint);
  font-weight: 700;
  font-size: 1.12em;
}
.p-due,
.p-due span:last-child {
  color: var(--p-blue);
}
.p-due span:last-child {
  font-size: 1.12em;
}
.p-block {
  margin-top: 1.7em;
}
.stamp {
  margin-left: 12%;
  padding: 0.5em 1.4em 0.55em;
  border: 0.24em solid #1f7a57;
  color: #1f7a57;
  text-align: center;
  rotate: -11deg;
  line-height: 1.1;
}
.stamp b {
  display: block;
  font-size: 3.1em;
  letter-spacing: 0.02em;
}
.stamp i {
  font-style: normal;
  font-weight: 700;
  font-size: 0.95em;
}

/* phone: the preview becomes a full-screen sheet, with a bar pinned below */
.mobile-bar {
  display: none;
}
@media (max-width: 900px) {
  .tool {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    overflow: auto;
    background: var(--desk);
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  }
  .previewing {
    overflow: hidden;
  }
  .previewing .preview {
    display: block;
  }
  .preview-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-family: var(--serif);
    font-size: 1.2rem;
  }
  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 10px);
    background: var(--panel);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -16px rgba(20, 26, 46, 0.5);
  }
  .mobile-total {
    margin-right: auto;
    min-width: 0;
    line-height: 1.2;
  }
  .mobile-total span {
    display: block;
    font-size: 0.75rem;
    color: var(--ink-2);
  }
  .mobile-total strong {
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .mobile-bar .btn {
    padding-inline: 13px;
  }
  body.has-tool {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
  }
  .toast {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 84px) !important;
  }
}

/* ---------- your invoices ---------- */
.ledger {
  margin-top: clamp(40px, 6vw, 72px);
}
.ledger-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 20px;
  margin-bottom: 12px;
}
.ledger-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.ledger-head p {
  margin: 0;
  color: var(--ink-2);
}
.ledger-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.empty {
  margin: 0;
  padding: 22px clamp(16px, 2.4vw, 24px);
  color: var(--ink-2);
  max-width: 70ch;
}
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 8px 20px;
  align-items: center;
  padding: 14px clamp(16px, 2.4vw, 24px);
  border-top: 1px solid var(--line);
}
.row:first-child {
  border-top: 0;
}
.row.is-open {
  box-shadow: inset 4px 0 0 var(--accent);
}
.row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  min-width: 0;
}
.row-no {
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.row-client {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.row-date {
  color: var(--ink-2);
  font-size: 0.875rem;
  width: 100%;
}
.row-money {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.row-money strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}
.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--chip-unpaid);
}
.is-overdue .chip {
  color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
.is-paid .chip {
  background: var(--chip-paid);
  color: var(--green);
  box-shadow: inset 0 0 0 1.5px var(--green);
  rotate: -2deg;
}
.chip.thud {
  animation: thud 0.22s ease-out;
}
@keyframes thud {
  from {
    scale: 1.9;
    opacity: 0;
  }
}
.row-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.ledger-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 6px;
}
@media (max-width: 860px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
  }
  .row-acts {
    justify-content: flex-start;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(560px, calc(100vw - 24px));
  padding: 12px 14px 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--desk);
  font-size: 0.95rem;
  box-shadow: var(--shadow);
}
.toast .btn {
  flex: none;
}

/* ---------- reading pages ---------- */
.prose {
  max-width: 44rem;
  margin-top: clamp(36px, 6vw, 64px);
}
.intro + .prose {
  margin-top: 0;
}
.prose h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  margin: 2.2em 0 0.5em;
}
.prose > h2:first-child {
  margin-top: 0;
}
.prose h3 {
  font-size: 1.15rem;
  margin: 1.6em 0 0.3em;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1em;
}
.prose li {
  margin-bottom: 0.4em;
}
.prose li::marker {
  color: var(--ink-2);
}
.prose .lede {
  font-size: 1.125rem;
  color: var(--ink-2);
}
.scroll {
  overflow-x: auto;
  margin-bottom: 1em;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.prose th,
.prose td {
  text-align: left;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose th {
  font-size: 0.85rem;
  color: var(--ink-2);
}
.prose td:not(:first-child),
.prose th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}
.note {
  padding: 12px 16px;
  border-left: 4px solid var(--copy-yellow);
  background: var(--panel);
  border-radius: 0 var(--r) var(--r) 0;
}
.steps {
  counter-reset: s;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  max-width: none;
}
.steps li {
  counter-increment: s;
  margin: 0;
}
.steps li::before {
  content: counter(s);
  display: block;
  font: 700 2rem/1 var(--serif);
  color: var(--red);
  margin-bottom: 6px;
}
.steps strong {
  display: block;
}
.wide-prose {
  max-width: none;
}
.links {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
  columns: 3 220px;
  column-gap: 32px;
}
.links li {
  break-inside: avoid;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.links a {
  font-weight: 600;
}
.links span {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.ad {
  margin: 32px 0;
  min-height: 100px;
}

/* ---------- footer ---------- */
.site-foot {
  margin-top: clamp(56px, 8vw, 96px);
  padding-block: 36px 28px;
  border-top: 1px solid var(--line);
  font-size: 0.925rem;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}
.site-foot h2 {
  font: 700 0.95rem/1.3 var(--sans);
  margin-bottom: 8px;
}
.site-foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-foot li {
  padding: 3px 0;
}
.site-foot a {
  color: var(--ink-2);
  text-decoration: none;
}
.site-foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.foot-cols {
  columns: 2;
  column-gap: 24px;
}
.foot-note {
  margin: 28px 0 0;
  color: var(--ink-2);
  max-width: 70ch;
}
@media (max-width: 760px) {
  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }
  .foot-grid nav:first-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- print: only the sheet ---------- */
@media print {
  body {
    background: #fff;
    padding: 0 !important;
  }
  body > *:not(main),
  main > *:not(.tool),
  .tool > *:not(.preview),
  .preview > *:not(.stack) {
    display: none !important;
  }
  .tool,
  .preview,
  .stack {
    display: block !important;
    position: static;
    margin: 0;
    padding: 0;
    max-width: none;
    overflow: visible;
    background: none;
  }
  .stack::before,
  .stack::after {
    display: none;
  }
  .paper-box {
    box-shadow: none;
  }
  .paper {
    min-height: 0;
    background: #fff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .paper .ghost {
    display: none;
  }
}
