/* Brief summary: a document, sized for A4. Uses the tokens in styles.css. */
.sm {
  background: var(--white); color: var(--text); max-width: 860px; margin: 0 auto;
  padding: 48px 56px 40px; border: 1px solid var(--line); border-radius: var(--radius);
  /* Every size below is in em, so the whole document scales from this one value (smaller when printed). */
  font-size: 15px; line-height: 1.55; display: grid; gap: 2.4em;
}
.sm h1, .sm h2, .sm h3 { color: var(--ink); }
.sm-head { display: grid; gap: 22px; padding-bottom: 28px; border-bottom: 2px solid var(--ink); }
.sm-logo { height: 26px; width: auto; }
.sm-eyebrow, .sm-glance dt, .sm-schedule th, .sm-section > h2 {
  font-family: var(--body); font-size: 0.8em; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--clay);
}
.sm-eyebrow { margin-bottom: 6px; }
.sm-title h1 { font-size: 2.6em; line-height: 1.1; }
.sm-meta { color: var(--muted); margin-top: 6px; }
.sm-glance { margin: 0; display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sm-glance div { background: var(--cream); padding: 0.95em 1.05em; }
.sm-glance dd { margin: 4px 0 0; font-family: var(--display); font-size: 1.45em; color: var(--ink); font-variant-numeric: lining-nums; line-height: 1.2; }
.sm-glance .sm-sub { margin: 2px 0 0; color: var(--muted); font-size: 0.9em; }
.sm-details { margin-top: -12px; }
.sm-section { display: grid; gap: 16px; }
.sm-section > h2, .sm h3 { break-after: avoid; }
.sm-keep { break-inside: avoid; }
.sm-section > h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sm h3 { font-family: var(--display); font-size: 1.2em; font-weight: 600; margin-bottom: 6px; }
.sm-lead { font-family: var(--display); font-size: 1.33em; color: var(--ink); }
.sm-muted { color: var(--muted); font-size: 0.93em; }
.sm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.sm-rank { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.sm-rank li::marker { color: var(--clay); font-weight: 600; }
.sm-schedule { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; align-items: start; }
.sm-cell { display: grid; gap: 20px; align-content: start; }
.sm-schedule table { width: 100%; border-collapse: collapse; font-size: 0.93em; break-inside: avoid; }
.sm-schedule th { text-align: left; padding: 0 0 6px; border-bottom: 1.5px solid var(--ink); }
.sm-schedule td { padding: 6px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.sm-schedule td:last-child { text-align: right; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; padding-left: 12px; }
.sm-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.sm-style { margin: 0; display: grid; gap: 12px; align-content: start; break-inside: avoid; }
.sm-style img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); display: block; }
.sm-style figcaption { display: grid; gap: 8px; }
.sm-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sm-chips li { font-size: 0.87em; padding: 2px 10px; border-radius: var(--radius); background: var(--cream-2); color: var(--clay-deep); }
.sm blockquote { margin: 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--tint); font-family: var(--display); font-style: italic; font-size: 1.13em; color: var(--ink); white-space: pre-line; }
.sm-arrival { max-width: 640px; break-inside: avoid; }
.sm-words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.sm-words > div { break-inside: avoid; }
.sm-block { break-inside: avoid; }
.sm-block + .sm-block { margin-top: 18px; }
.sm-pairs { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); font-size: 0.93em; }
.sm-pairs dt, .sm-pairs dd { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.sm-pairs dt { color: var(--muted); padding-right: 16px; }
.sm-pairs dd { color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.sm-pairs dd.sm-empty { color: var(--line); }
.sm-foot { padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8em; }

@media screen and (max-width: 700px) {
  .sm { padding: 28px 20px; gap: 28px; }
  .sm-title h1 { font-size: 2em; }
  .sm-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-two, .sm-schedule, .sm-styles, .sm-words { grid-template-columns: minmax(0, 1fr); }
  .sm-pairs { grid-template-columns: minmax(0, 1fr); }
  .sm-pairs dt { border-bottom: 0; padding-bottom: 0; }
}

/* Print edge to edge so the paper colour reaches the edges of the sheet; the margin
   lives inside the summary instead, and repeats on every page. */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: var(--white) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none !important; }
  .sm {
    border: 0; border-radius: 0; max-width: none; font-size: 8.5pt;
    padding: 14mm; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  }
  .sm, .sm * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sm-style img { aspect-ratio: 16 / 10; }
  .sm-full { break-before: auto; }
  /* One column, each question and answer on a line: compact and nothing can spill off the page. */
  .sm-full .sm-block { margin: 0 0 14px; break-inside: auto; }
  .sm-full .sm-pairs { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .sm-full .sm-pairs dt, .sm-full .sm-pairs dd { padding: 3px 0; break-inside: avoid; }
}

/* summary.html page chrome */
.summary-page { background: var(--cream); }
.summary-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--white); border-bottom: 1px solid var(--line);
}
.summary-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary-bar label.btn { cursor: pointer; }
.summary-wrap { padding-block: 32px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.summary-empty { max-width: 560px; margin: 10vh auto; text-align: center; display: grid; gap: 12px; }
@media print { .summary-wrap { padding: 0; } .summary-page { background: var(--white); } }

/* Printing from the thank-you screen prints the summary only. */
@media print {
  .done, .done-tech, .confetti, .toast, .done-summary > .eyebrow { display: none !important; }
  .stage { padding: 0 !important; }
  .done-summary { max-width: none; margin: 0; }
}
