/* Dedicated Q/A sheet styling — shares Space Grotesk + JetBrains Mono Manuscript tokens (desktop) and Schibsted Grotesk + Spline Sans Mono (mobile). */
.qa-progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--paper);
  z-index: 89;
  pointer-events: none;
}

.qa-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--ink-1);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 90;
  pointer-events: none;
}

.qa-toc-toggle {
  display: none;
}

.m-sec[data-qa-group] {
  scroll-margin-top: 24px;
}

.qa-head {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.qa-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.qa-kicker {
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

body[data-fm="1"] .qa-head .theme-toggle {
  margin: 0;
}

.qa-head .theme-toggle:focus-visible {
  outline: 2px solid var(--ink-1);
  outline-offset: 2px;
  border-radius: 999px;
}

.qa-title {
  margin-top: 12px;
  font-family: var(--f-display);
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink-1);
}

.qa-sub {
  margin-top: 14px;
  max-width: 62ch;
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
}

.qa-meta-row {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.qa-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font: 500 11.5px/1.6 var(--f-mono);
  color: var(--ink-3);
}

.qa-toc a {
  text-decoration: none;
  color: var(--ink-3);
  padding: 2px 0;
  transition: color 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .qa-toc a:hover {
    color: var(--ink-1);
  }
}

.qa-head .theme-toggle {
  margin: 0;
}

.qa-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.qa-item {
  display: grid;
  grid-template-columns: var(--tab-col, 160px) minmax(0, 1fr);
  column-gap: 24px;
  align-items: baseline;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.qa-item:first-child {
  padding-top: 4px;
  border-top: 0;
}

.qa-num {
  font: 500 11.5px/1.6 var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.qa-body {
  min-width: 0;
}

.qa-q {
  font-family: var(--f-display);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-1);
}

.qa-a {
  margin-top: 8px;
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}

.qa-foot {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font: 400 12px/1.6 var(--f-mono);
  color: var(--ink-3);
}

.qa-foot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

@media (max-width: 760px) {
  body[data-fm="1"] {
    --f-display: "Schibsted Grotesk", system-ui, sans-serif;
    --f-body: "Spline Sans Mono", ui-monospace, monospace;
    --f-mono: "Spline Sans Mono", ui-monospace, monospace;
    --body-size: 13.5px;
    --body-lh: 1.66;
    --sec-pt: 38px;
  }

  .sheet-host {
    max-width: 460px;
    padding: max(48px, env(safe-area-inset-top)) 18px 116px !important;
  }

  /* Floating frosted bottom thumb dock (matches mobile résumé) */
  .corner-actions {
    top: auto;
    right: auto;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    max-width: calc(100vw - 20px);
    padding: 4px;
    gap: 2px;
    flex-wrap: nowrap;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--bar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  }

  .corner-actions .sb-print {
    border: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    min-height: 44px;
    min-width: 44px;
    padding: 0 10px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Centered editorial cover matching mobile résumé */
  .qa-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 0 40px;
    border-bottom: 0;
  }

  .qa-kicker-row {
    display: contents;
  }

  .qa-kicker {
    order: 1;
    font-size: 10.5px;
  }

  .qa-title {
    order: 2;
    margin-top: 10px;
    font-size: 36px;
    line-height: 1.04;
  }

  .qa-sub {
    order: 3;
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.5;
    max-width: 34ch;
  }

  /* Native iOS thumb-sized theme toggle */
  body[data-fm="1"] .qa-head .theme-toggle {
    order: 4;
    margin: 20px auto 0;
    min-width: 60px;
    min-height: 48px;
  }

  .qa-head .tt-track {
    width: 58px;
    height: 32px;
    padding: 3px;
    border-color: var(--rule-strong);
    background: var(--paper);
    display: inline-flex;
    align-items: center;
  }

  .qa-head .tt-dot {
    position: static;
    width: 24px;
    height: 24px;
    transform: translateX(0);
  }

  .qa-head .theme-toggle[aria-checked="true"] .tt-dot,
  :is(html[data-theme="dark"], html.dark) .qa-head .tt-dot {
    transform: translateX(26px);
  }

  .qa-head .tt-slot {
    display: none;
  }

  /* Collapsible jump-to-section menu on mobile */
  .qa-meta-row {
    order: 5;
    width: 100%;
    margin-top: 24px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .qa-toc-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink-2);
    font: 500 11.5px/1 var(--f-mono);
    letter-spacing: 0.03em;
    cursor: pointer;
  }

  .qa-toc-toggle:active {
    background: var(--tone);
  }

  .qa-toc {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 4px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    text-align: left;
  }

  .qa-toc.is-open {
    display: flex;
  }

  .qa-toc a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
    border-top: 1px solid var(--rule);
    font-size: 12px;
    color: var(--ink-2);
  }

  .qa-toc a:first-child {
    border-top: 0;
  }

  .qa-list {
    gap: 20px;
  }

  .qa-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 20px;
  }

  .qa-q {
    font-size: 17px;
    line-height: 1.34;
  }

  .qa-a {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.68;
  }

  .qa-foot {
    margin-top: 48px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .qa-foot-links {
    gap: 4px 16px;
  }

  .qa-foot-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

@media print {
  .qa-progress-rail,
  .qa-progress,
  .qa-toc-toggle {
    display: none !important;
  }

  .qa-head {
    padding: 0 0 16px;
  }

  .qa-toc {
    display: none;
  }

  .qa-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
