/* Help: one sheet with every answer open. The questions asked most sit on top
   as index cards, a search box narrows the rest as you type, and each answer
   sits beside its question, like a note in the margin. */
.help { max-width: 960px; }
.help a { text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.help .lead { max-width: 60ch; }
.help b { font-weight: 700; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Search: a pill on the paper ---------- */
.help-find { display: block; max-width: 560px; margin-top: 28px; }
.help-find[hidden] { display: none; }
.find-field { position: relative; }
.find-field svg { position: absolute; left: 17px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px; color: var(--ink-soft); pointer-events: none; }
.find-field input { width: 100%; min-height: 52px; padding: 0 18px 0 47px; border: 1.5px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--ink); font: 500 17px/1.2 var(--body); box-shadow: inset 0 1px 2px rgba(30, 15, 4, 0.06); -webkit-appearance: none; appearance: none; transition: border-color 160ms ease; }
.find-field input::placeholder { color: var(--ink-soft); opacity: 1; }
.find-field input:focus { border-color: var(--gold); }
.find-field input:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 2px; }
.find-field input::-webkit-search-cancel-button { cursor: pointer; }
.find-count { font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.find-count:not(:empty) { margin-top: 10px; }
.find-count a { color: var(--ink); }
/* The words it found, marked with a highlighter (CSS Custom Highlight API; no marks where it's missing) */
::highlight(help-match) { background-color: color-mix(in srgb, var(--gold) 42%, transparent); color: var(--ink); }

/* ---------- Asked most: six index cards on the sheet ---------- */
.quick { margin-top: 40px; }
.quick-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.scrawl { display: inline-flex; align-items: flex-end; gap: 4px; font: 700 19px/1 "Kalam", "Bradley Hand", cursive; letter-spacing: 0; color: var(--gold-ink); transform: rotate(-4deg) translateY(-3px); }
.scrawl svg { width: 28px; height: 26px; margin-bottom: -10px; }
.quick-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 236px), 1fr)); gap: 20px 18px; margin-top: 20px; padding: 0; list-style: none; }
.quick-card { position: relative; padding: 15px 18px 16px; border-radius: 3px; background: var(--card); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 6px 16px rgba(30, 15, 4, 0.17); transform: rotate(var(--tilt, 0deg)); transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 220ms ease; }
.quick-card:nth-child(3n + 1) { --tilt: -0.5deg; }
.quick-card:nth-child(3n + 2) { --tilt: 0.4deg; }
.quick-card:nth-child(3n) { --tilt: -0.25deg; }
.quick-card h3 { padding: 0 24px 9px 0; border-bottom: 2px solid var(--margin-red); font: 700 19px/1.25 var(--display); letter-spacing: -0.005em; text-wrap: balance; }
.quick-card h3 a { color: inherit; text-decoration: none; }
/* The whole card opens the full answer further down */
.quick-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 3px; }
.quick-card::after { content: "↓"; position: absolute; top: 14px; right: 15px; font: 700 19px/1 var(--display); color: var(--gold-ink); transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1); }
/* Written on ruled lines, like a real index card */
.quick-card p { margin-top: 8px; font-size: 15.5px; line-height: 24px; text-wrap: pretty; background: repeating-linear-gradient(to bottom, transparent 0 23px, color-mix(in srgb, var(--rule) 75%, transparent) 23px 24px); }
@media (hover: hover) and (pointer: fine) {
  .quick-card:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 12px 24px rgba(30, 15, 4, 0.22); }
  .quick-card:hover::after { transform: translateY(3px); }
  .quick-card:hover h3 a { text-decoration: underline; text-decoration-color: var(--gold); }
}
.quick-card:active { transform: rotate(0deg) scale(0.985); }
@supports selector(:has(*)) {
  .quick-card h3 a:focus-visible { outline: none; }
  .quick-card:has(a:focus-visible) { transform: none; outline: 3px solid var(--gold); outline-offset: 3px; }
}

/* ---------- Topics: index tabs above the answers ---------- */
.help-jump { margin-top: 52px; }
.jump-label { font: 800 12.5px/1 var(--body); letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft); }
.help-jump ul { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 0; list-style: none; }
.help-jump a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 15px; font-weight: 650; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .help-jump a:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--card)); } }
.help-jump a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Every answer, open: the question in the margin, the answer beside it ---------- */
.help-sec { margin-top: 48px; scroll-margin-top: 24px; }
.help-sec h2 { font: 700 clamp(25px, 2.6vw, 31px)/1.2 var(--display); letter-spacing: -0.01em; }
.help-q { display: grid; gap: 8px; padding: 18px 0 20px; border-top: 1.5px solid var(--rule); scroll-margin-top: 24px; }
.help-sec h2 + .help-q { margin-top: 14px; }
.help-q:last-child { border-bottom: 1.5px solid var(--rule); }
.help-q h3 { max-width: 34ch; font: 700 19px/1.3 var(--display); letter-spacing: -0.005em; text-wrap: balance; }
.help-a { display: grid; gap: 10px; align-content: start; }
.help-a p, .help-a li { max-width: 64ch; font-size: 16.5px; line-height: 1.55; text-wrap: pretty; }
.help-a h4 { margin: 8px 0 -2px; font: 700 17px/1.3 var(--display); }
.help-a ul { display: grid; gap: 6px; margin: 0; padding-left: 22px; }
.help-a ul li::marker { color: var(--gold-ink); }
/* Steps: numbered in gold rings */
.steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding-left: 38px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 26px; height: 26px; border: 1.5px solid var(--gold); border-radius: 50%; background: color-mix(in srgb, var(--gold) 12%, var(--sheet)); color: var(--gold-ink); font: 700 14px/1 var(--display); }
@media (min-width: 900px) {
  .help-q { grid-template-columns: minmax(0, 15.5rem) minmax(0, 1fr); column-gap: 40px; padding: 20px 0 22px; }
  .help-q h3 { padding-top: 1px; }
}

/* Linked straight to an answer (/help#calendars): a highlighter stroke across its question, briefly */
.help .is-target { background: linear-gradient(transparent 30%, color-mix(in srgb, var(--gold) 40%, transparent) 30% 92%, transparent 92%) no-repeat 0 0 / 100% 100%; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (prefers-reduced-motion: no-preference) {
  .help .is-target { animation: help-swipe 520ms cubic-bezier(0.23, 1, 0.32, 1) both; }
  @keyframes help-swipe { from { background-size: 0% 100%; } }
}
.help h2[tabindex="-1"]:focus, .help h3[tabindex="-1"]:focus { outline: none; }

/* Searching: only the answers that match, close together */
.help.filtering .quick, .help.filtering .help-jump { display: none; }
.help-sec[hidden], .help-q[hidden] { display: none; }
.help.filtering .help-sec { margin-top: 30px; }
.help.filtering .help-q:has(~ .help-q:not([hidden])) { border-bottom: 0; }
.help.filtering .help-q:not(:has(~ .help-q:not([hidden]))) { border-bottom: 1.5px solid var(--rule); }

.help kbd, .help code { padding: 1px 6px; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); font: 600 0.88em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }

.help-more { margin-top: 48px; }
.help-more h2 { font: 700 24px/1.2 var(--display); }
.help-more p { margin-top: 8px; font-size: 17px; }

@media (max-width: 600px) {
  .quick-list { gap: 14px; }
  .quick-card { --tilt: 0deg !important; padding: 13px 15px 14px; }
  .quick-card h3 { font-size: 18px; padding-bottom: 7px; }
  .quick-card p { margin-top: 6px; font-size: 15px; line-height: 23px; background-image: repeating-linear-gradient(to bottom, transparent 0 22px, color-mix(in srgb, var(--rule) 75%, transparent) 22px 23px); }
  .quick-card::after { top: 12px; right: 13px; }
  .find-field input { padding-left: 44px; }
  .find-field svg { left: 15px; }
  .scrawl { font-size: 17px; }
  .help-q h3 { font-size: 18px; }
  .help-a p, .help-a li { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.help) { scroll-behavior: auto; }
  .quick-card, .quick-card::after, .find-field input { transition: none; }
}
@media (prefers-reduced-motion: no-preference) { html:has(.help) { scroll-behavior: smooth; } }
