/* DispatchLedger components. Plain CSS classes (dl-*), mobile first.
   Every value comes from tokens.css. Breakpoints: 768px (tablet), 1024px (desktop). */

/* ---------- Base ---------- */
.dl-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}
.dl-page *, .dl-page *::before, .dl-page *::after { box-sizing: border-box; }
.dl-container { width: 100%; max-width: calc(var(--container) + 2 * var(--space-6)); margin: 0 auto; padding: 0 var(--space-4); }
.dl-section { padding: var(--space-16) 0; scroll-margin-top: var(--space-4); }
.dl-section--sunk { background: var(--paper-sunk); }
.dl-page :where(p) { margin: 0 0 var(--space-4); max-width: var(--measure); }
.dl-page :where(p:last-child) { margin-bottom: 0; }
.dl-page :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (min-width: 768px) { .dl-container { padding: 0 var(--space-6); } }
@media (min-width: 1024px) { .dl-section { padding: var(--space-24) 0; } }

/* ---------- Header ---------- */
.dl-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.dl-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--header-height); }
.dl-wordmark { font-family: var(--font-serif); font-weight: 600; font-size: 20px; line-height: 24px; color: var(--ink); text-decoration: none; letter-spacing: -0.005em; }
.dl-header .dl-button { display: none; }
@media (min-width: 768px) { .dl-header .dl-button { display: inline-flex; } }

/* ---------- Button: the only button on the page ---------- */
.dl-button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap-min); padding: var(--space-3) var(--space-6);
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-sans); font-weight: 600; font-size: 16px; line-height: 20px;
  border: 0; border-radius: var(--radius-md); text-decoration: none; cursor: pointer;
  transition: background-color 120ms ease;
}
.dl-button:hover { background: var(--accent-strong); }
.dl-button:active { background: var(--accent-strong); transform: translateY(1px); }
.dl-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.dl-button--block { display: flex; width: 100%; }
@media (min-width: 768px) { .dl-button--block { display: inline-flex; width: auto; } }

/* Sticky mobile button: shown after the hero, hidden at 768px+ */
.dl-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--rule);
}
.dl-sticky .dl-button { width: 100%; }
.dl-sticky[hidden] { display: none; }
@media (min-width: 768px) { .dl-sticky { display: none; } }

/* ---------- Eyebrow, headings ---------- */
.dl-eyebrow { display: block; margin: 0 0 var(--space-2); color: var(--accent); font-family: var(--font-sans); font-weight: 600; font-size: 13px; line-height: 20px; letter-spacing: 0.08em; text-transform: uppercase; }
.dl-h1 { margin: 0 0 var(--space-4); max-width: 18ch; font-family: var(--font-serif); font-weight: 500; font-size: 36px; line-height: 40px; letter-spacing: -0.005em; color: var(--ink); }
.dl-mark { background: linear-gradient(transparent 58%, var(--highlight) 58%, var(--highlight) 92%, transparent 92%); padding: 0 2px; border-radius: var(--radius-sm); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.dl-h2 { margin: 0; max-width: 22ch; font-family: var(--font-serif); font-weight: 500; font-size: 26px; line-height: 32px; color: var(--ink); }
.dl-h3 { margin: 0 0 var(--space-2); font-family: var(--font-sans); font-weight: 600; font-size: 16px; line-height: 26px; color: var(--ink); }
.dl-subhead { margin: var(--space-3) 0 0; max-width: var(--measure); font-size: 17px; line-height: 28px; color: var(--muted); }
.dl-lede { margin: 0 0 var(--space-6); max-width: 36em; font-size: 17px; line-height: 28px; color: var(--ink); }
.dl-section-head { margin-bottom: var(--space-8); }
.dl-section-head::before { content: ""; display: block; width: 48px; height: 5px; margin-bottom: var(--space-6); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
@media (min-width: 768px) {
  .dl-h2 { font-size: 30px; line-height: 36px; }
  .dl-subhead, .dl-lede { font-size: 19px; line-height: 30px; }
}
@media (min-width: 1024px) { .dl-h1 { font-size: 48px; line-height: 52px; } .dl-section-head { margin-bottom: var(--space-12); } }

/* ---------- Hero ---------- */
.dl-hero { padding: var(--space-8) 0 var(--space-12); }
.dl-hero__actions { display: flex; flex-direction: column; gap: var(--space-3); align-items: stretch; }
.dl-qualify { margin: 0; max-width: 40em; font-size: 14px; line-height: 20px; color: var(--muted); }
.dl-hero__note { margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid var(--rule); color: var(--ink); max-width: var(--measure); }
.dl-hero__aside { margin-top: var(--space-8); padding-top: var(--space-4); border-top: 3px double var(--ink); max-width: var(--measure); }
.dl-hero__aside p { margin: 0; }
@media (min-width: 768px) { .dl-hero__actions { align-items: flex-start; } .dl-qualify { font-size: 13px; } }
@media (min-width: 1024px) {
  .dl-hero { padding: var(--space-24) 0 var(--space-16); }
  .dl-hero__grid { display: grid; grid-template-columns: 7fr 4fr; gap: var(--space-16); align-items: end; }
  .dl-hero__aside { margin-top: 0; margin-bottom: var(--space-2); }
}

/* ---------- Bullet list: bold-led ---------- */
.dl-bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); max-width: var(--measure); }
.dl-bullets li { position: relative; padding-left: var(--space-6); }
.dl-bullets li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 7px; height: 7px; background: var(--accent); border-radius: 1px; }
.dl-bullets strong { font-weight: 600; }
/* Ledger variant: rows ruled like an invoice, lead on its own column at 768px+ */
.dl-bullets--ledger { gap: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); max-width: none; }
.dl-bullets--ledger li { padding: var(--space-4) 0; border-top: 1px solid var(--rule); }
.dl-bullets--ledger li:first-child { border-top: 0; }
.dl-bullets--ledger li::before { display: none; }
@media (min-width: 768px) {
  .dl-bullets--ledger li { display: grid; grid-template-columns: 9rem 1fr; gap: var(--space-6); }
}

/* ---------- Point list: bold heading line + one sentence ---------- */
.dl-points { display: grid; gap: var(--space-6); margin: 0; padding: 0; list-style: none; }
.dl-point { padding-top: var(--space-4); border-top: 1px solid var(--ink); }
.dl-point .dl-h3 { margin-bottom: var(--space-1); }
.dl-point p { margin: 0; }
@media (min-width: 768px) { .dl-points { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); } }

/* ---------- Learn blocks (three equal blocks) ---------- */
.dl-blocks { display: grid; gap: var(--space-4); margin: 0 0 var(--space-8); padding: 0; list-style: none; }
.dl-block { padding: var(--space-6); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); }
.dl-block__index { display: block; margin-bottom: var(--space-4); color: var(--muted); font-size: 13px; line-height: 20px; font-weight: 600; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.dl-block p { margin: 0; }
@media (min-width: 768px) { .dl-blocks { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); } }

/* ---------- Numbered step card ---------- */
.dl-steps { display: grid; gap: var(--space-8); margin: 0 0 var(--space-12); padding: 0; list-style: none; counter-reset: dl-step; }
.dl-step { counter-increment: dl-step; display: grid; align-content: start; grid-template-columns: 48px 1fr; gap: var(--space-4); }
.dl-step::before { content: counter(dl-step); font-family: var(--font-serif); font-weight: 600; font-size: 48px; line-height: 48px; color: var(--accent); font-variant-numeric: tabular-nums lining-nums; }
.dl-step p { margin: 0; }
@media (min-width: 768px) {
  .dl-steps { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
  .dl-step { grid-template-columns: 1fr; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--ink); }
}

/* ---------- Price block ---------- */
.dl-price { background: var(--surface); border: 1px solid var(--ink); border-radius: var(--radius-md); }
.dl-price__row { padding: var(--space-6); border-bottom: 1px solid var(--rule); }
.dl-price__row:last-of-type { border-bottom: 0; }
.dl-price__figure { display: block; margin-bottom: var(--space-2); font-family: var(--font-serif); font-weight: 600; font-size: 40px; line-height: 44px; color: var(--accent); font-variant-numeric: tabular-nums lining-nums; }
.dl-price__unit { font-family: var(--font-sans); font-weight: 400; font-size: 16px; line-height: 26px; color: var(--muted); }
.dl-price__included { padding: var(--space-6); border-top: 3px double var(--ink); }
@media (min-width: 768px) { .dl-price__rows { display: grid; grid-template-columns: 1fr 1fr; } .dl-price__row { border-bottom: 0; } .dl-price__row + .dl-price__row { border-left: 1px solid var(--rule); } }

/* ---------- FAQ accordion item (native details/summary) ---------- */
.dl-faq { max-width: var(--measure); border-top: 1px solid var(--ink); }
.dl-faq__item { border-bottom: 1px solid var(--rule); }
.dl-faq__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: var(--tap-min); padding: var(--space-3) 0; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--ink);
}
.dl-faq__item summary::-webkit-details-marker { display: none; }
.dl-faq__item summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background: linear-gradient(var(--ink), var(--ink)) center / 14px 2px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 2px 14px no-repeat;
}
.dl-faq__item[open] summary::after { background: linear-gradient(var(--ink), var(--ink)) center / 14px 2px no-repeat; }
.dl-faq__item summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dl-faq__answer { padding: 0 0 var(--space-6); }

/* ---------- Form ---------- */
.dl-form { display: grid; gap: var(--space-6); max-width: 560px; padding: var(--space-6); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); }
.dl-field { display: grid; gap: var(--space-1); }
.dl-label { font-weight: 600; font-size: 16px; line-height: 24px; color: var(--ink); }
.dl-input, .dl-select {
  width: 100%; min-height: var(--tap-min); padding: var(--space-3) var(--space-3);
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--field-border); border-radius: var(--radius-sm);
}
.dl-select { appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.dl-input:focus-visible, .dl-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.dl-field--error .dl-input, .dl-field--error .dl-select { border-color: var(--error); border-width: 2px; padding: 11px; }
.dl-field__error { margin: 0; font-size: 13px; line-height: 20px; color: var(--error); font-weight: 600; }
.dl-form__note { margin: 0; font-size: 13px; line-height: 20px; color: var(--muted); }
@media (min-width: 768px) { .dl-form { padding: var(--space-8); } }

/* ---------- Calendar container (embed slot, no layout shift) ---------- */
.dl-calendar { max-width: 720px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.dl-calendar__head { padding: var(--space-6); border-bottom: 1px solid var(--rule); }
.dl-calendar__head p { margin: 0; }
.dl-calendar__frame { display: block; width: 100%; height: 680px; border: 0; background: var(--surface); }
.dl-calendar__slot { display: grid; place-items: center; height: 680px; padding: var(--space-6); color: var(--muted); font-size: 13px; text-align: center; outline: 1px dashed var(--field-border); outline-offset: -12px; }
.dl-message { max-width: 560px; padding: var(--space-6); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
@media (min-width: 768px) { .dl-calendar__frame, .dl-calendar__slot { height: 720px; } }

/* ---------- Footer ---------- */
.dl-footer { padding: var(--space-12) 0 calc(var(--space-12) + 72px); background: var(--ink); color: var(--paper); font-size: 13px; line-height: 20px; }
.dl-footer a { color: var(--paper); text-underline-offset: 3px; }
.dl-footer a:focus-visible { outline-color: var(--paper); }
.dl-footer__row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); align-items: baseline; }
.dl-footer .dl-wordmark { color: var(--paper); font-size: 18px; }
.dl-footer__meta { margin-top: var(--space-4); color: var(--ink-inverse-muted); }
@media (min-width: 768px) { .dl-footer { padding-bottom: var(--space-12); } }

/* ---------- Utilities ---------- */
.dl-cta-row { margin-top: var(--space-12); }
.dl-stack-8 > * + * { margin-top: var(--space-8); }
.dl-stack-12 > * + * { margin-top: var(--space-12); }
.dl-placeholder { outline: 1px dashed var(--field-border); outline-offset: 2px; }

/* Failure message under the form */
.dl-message--error { border-color: var(--accent, currentColor); }
