/* QA Handbook hub and guide pages, using the portfolio's shared light/dark tokens. */
.qa-handbook { width: var(--home-content-width); max-width: 1600px; margin: 0 auto; padding: 32px 0 56px; color: var(--home-text); font: 14px/1.7 'Manrope', sans-serif; }
.qa-handbook * { box-sizing: border-box; }
.qa-handbook :is(h1,h2,h3,p,ul,dl) { margin-top: 0; }
.qa-handbook :is(h1,h2,h3) { color: var(--home-text); text-transform: none; font-family: 'Manrope', sans-serif; }
.qa-handbook a { color: var(--home-accent); }
.qa-handbook svg { width: 18px; height: 18px; flex: none; }
/* Override the legacy template's !important focus reset within this page only. */
.qa-handbook :is(a, [tabindex]):focus-visible { outline: 2px solid var(--home-accent) !important; outline-offset: 3px; }
.qah-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.qah-topline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 12px; }

.qah-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 48px; padding: 18px 0 28px; border-bottom: 1px solid var(--home-line); }
.qah-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 0; color: var(--home-accent); font: 500 12px/1.5 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: 1px; }
.qa-handbook h1 { font-size: clamp(30px, 3.5vw, 54px); font-weight: 800; line-height: 1.15; letter-spacing: -1.6px; margin: 12px 0 14px; max-width: 900px; }
.qah-lead { color: var(--home-muted); font-size: 15px; max-width: 820px; margin-bottom: 0; }
.qah-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 8px; margin: 0; }
.qah-stats div { min-width: 120px; padding: 12px 16px; border: 1px solid var(--home-line); border-radius: 10px; background: var(--home-surface); }
.qah-stats dt { color: var(--home-muted); font-size: 12px; font-weight: 600; }
.qah-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }

.qah-section { margin-top: 32px; }
.qah-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-bottom: 16px; }
.qah-section__head h2, .qah-widget h2 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; line-height: 1.4; margin-bottom: 0; }
.qah-section__head p { color: var(--home-muted); margin: 0; }

.qah-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.qah-card { display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid var(--home-line); border-radius: 12px; background: var(--home-surface); transition: border-color .2s, transform .2s; }
.qah-card--live { border-color: var(--home-accent); box-shadow: inset 0 3px var(--home-accent); }
.qah-card--live:hover { transform: translateY(-2px); }
.qah-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.qah-card__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--home-tint); color: var(--home-accent); }
.qah-card__icon svg { width: 22px; height: 22px; }
.qah-card__index { color: var(--home-muted); font: 500 12px/1 'IBM Plex Mono', monospace; }
.qah-status { margin-left: auto; padding: 3px 10px; border: 1px solid var(--home-line); border-radius: 999px; color: var(--home-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.qah-status--live { color: var(--home-accent); border-color: var(--home-accent); background: var(--home-tint); }
.qah-card h3 { font-size: 17px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.qah-card__summary { color: var(--home-muted); font-size: 13px; margin-bottom: 16px; }
.qah-card__label { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.qah-card__learn { padding-left: 18px; font-size: 13px; margin-bottom: 16px; }
.qah-card__learn li + li { margin-top: 4px; }
.qah-card__facts { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: auto 0 16px; }
.qah-card__facts li { padding: 2px 8px; border-radius: 6px; background: var(--home-tint); font: 500 11px/1.6 'IBM Plex Mono', monospace; color: var(--home-text); }
.qah-card__link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding-top: 12px; border-top: 1px solid var(--home-line); font-weight: 700; font-size: 13px; text-decoration: none; }
.qah-card__link--soon { color: var(--home-muted); font-weight: 600; }

.qah-widget { min-width: 0; padding: 22px; border: 1px solid var(--home-line); border-radius: 12px; background: var(--home-surface); }
.qah-widget h2 { margin-bottom: 16px; }

.qah-links { list-style: none; padding: 0; margin: 0; }
.qah-links li + li { border-top: 1px solid var(--home-line); }
.qah-links a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; min-height: 44px; padding: 12px 0; text-decoration: none; }
.qah-links strong { color: var(--home-text); font-size: 14px; }
.qah-links span { grid-row: 2; color: var(--home-muted); font-size: 13px; }
.qah-links svg { grid-row: 1 / 3; grid-column: 2; transition: transform .2s; }
.qah-links a:hover svg { transform: translateX(3px); }

/* Guide navigation shared by every guide page, including the SDLC guide. */
.qah-guide-shell { padding: 24px 0 0; }
.qah-guide-shell + #section-qa-workflow .sdlc-guide { padding-top: 16px; }
#section-qa-workflow + .qah-guide-shell { padding: 0 0 56px; }
.qah-guide-nav { display: grid; gap: 14px; }
.qah-breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; font-size: 12px; color: var(--home-muted); }
.qah-breadcrumb li + li::before { content: '/'; margin-right: 4px; color: var(--home-line); }
.qah-breadcrumb [aria-current] { color: var(--home-text); font-weight: 700; }
.qah-switcher { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.qah-switcher a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--home-line); border-radius: 8px; background: var(--home-surface); color: var(--home-muted); font-weight: 700; font-size: 13px; text-decoration: none; transition: border-color .2s, color .2s; }
.qah-switcher a:hover { border-color: var(--home-accent); color: var(--home-text); }
.qah-switcher a[aria-current="page"] { color: var(--home-accent); border-color: var(--home-accent); background: var(--home-tint); box-shadow: inset 0 -3px var(--home-accent); }
.qah-switcher span { font: 500 11px/1 'IBM Plex Mono', monospace; }
.qah-switcher small { margin-left: auto; padding: 1px 8px; border: 1px solid var(--home-line); border-radius: 999px; font-size: 10px; font-weight: 600; }

/* Guide pages with initial notes or a planned outline. */
.qah-guide .qah-hero { padding-top: 28px; }
.qah-hero__status { max-width: 300px; padding: 14px 16px; border: 1px dashed var(--home-line); border-radius: 10px; background: var(--home-surface); }
.qah-hero__status p { margin: 10px 0 0; color: var(--home-muted); font-size: 13px; line-height: 1.6; }
.qah-hero__status .qah-status { margin-left: 0; }
.qah-guide-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 32px; align-items: start; }
.qah-guide-body--full { grid-template-columns: minmax(0, 1fr); }
.qah-guide-aside { display: grid; gap: 16px; }
.qah-notes { display: grid; gap: 16px; min-width: 0; }
.qah-note { font-size: 15px; overflow-wrap: anywhere; }
.qah-note h3 { font-size: 16px; line-height: 1.5; margin: 22px 0 10px; }
.qah-note :is(ul, ol) { padding-left: 22px; }
.qah-note li + li { margin-top: 8px; }
.qah-note > :last-child { margin-bottom: 0; }
.qah-definitions { margin-bottom: 20px; }
.qah-definitions > div { padding: 14px 0; border-top: 1px solid var(--home-line); }
.qah-definitions > div:first-child { padding-top: 0; border-top: 0; }
.qah-definitions dt { color: var(--home-text); font-weight: 800; }
.qah-definitions dd { margin: 4px 0 0; color: var(--home-muted); }
.qah-note-result { padding: 14px 16px; border-left: 3px solid var(--home-accent); border-radius: 4px; background: var(--home-tint); }
.qah-glossary [hidden] { display: none !important; }
.qah-letter-filter { display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; padding: 4px; margin: 16px 0 8px; }
.qah-letter-filter button { flex: 1 0 20px; min-width: 20px; min-height: 28px; padding: 3px 2px; border: 1px solid var(--home-line); border-radius: 5px; background: var(--home-surface); color: var(--home-text); font: 700 11px/1.5 'Manrope', sans-serif; cursor: pointer; }
.qah-letter-filter button[data-glossary-letter="ALL"] { flex-basis: 30px; }
.qah-letter-filter button:enabled:hover { border-color: var(--home-accent); }
.qah-letter-filter button:disabled { opacity: .3; cursor: default; }
.qah-letter-filter button[aria-pressed="true"] { color: var(--home-accent); border-color: var(--home-accent); background: var(--home-tint); box-shadow: inset 0 -3px var(--home-accent); }
.qah-letter-filter button:focus-visible { outline: 2px solid var(--home-accent) !important; outline-offset: 3px; }
.qah-glossary-status, .qah-glossary-empty { color: var(--home-muted); font-size: 13px; }
.qah-glossary-controls { scroll-margin-top: calc(var(--home-header-height, 100px) + 20px); }
.qah-glossary-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--home-line); }
.qah-glossary-pagination button { min-height: 40px; padding: 8px 14px; border: 1px solid var(--home-line); border-radius: 6px; background: var(--home-surface); color: var(--home-text); font: 700 12px/1.5 'Manrope', sans-serif; cursor: pointer; }
.qah-glossary-pagination button:enabled:hover { border-color: var(--home-accent); }
.qah-glossary-pagination button:disabled { opacity: .3; cursor: default; }
.qah-glossary-pagination button:focus-visible { outline: 2px solid var(--home-accent) !important; outline-offset: 3px; }
.qah-glossary-page-label { color: var(--home-muted); font-size: 12px; white-space: nowrap; }
.qah-outline ol { list-style: none; counter-reset: outline; padding: 0; margin: 0; }
.qah-outline li { counter-increment: outline; display: flex; gap: 14px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--home-line); font-weight: 600; }
.qah-outline li:first-child { border-top: 0; padding-top: 0; }
.qah-outline li::before { content: counter(outline, decimal-leading-zero); color: var(--home-accent); font: 500 12px/1 'IBM Plex Mono', monospace; }
.qah-guide-aside .qah-card__facts { margin: 0; }
.qah-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.qah-pager a { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--home-line); border-radius: 10px; background: var(--home-surface); color: var(--home-text); font-weight: 700; text-decoration: none; transition: border-color .2s; }
.qah-pager a:hover { border-color: var(--home-accent); }
.qah-pager small { color: var(--home-muted); font-size: 12px; font-weight: 600; }
.qah-pager__prev small::before { content: '← '; }
.qah-pager__next { text-align: right; }
.qah-pager__next small::after { content: ' →'; }

@media (max-width: 1200px) { .qah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .qah-hero { grid-template-columns: minmax(0, 1fr); }
  .qah-guide-body { grid-template-columns: minmax(0, 1fr); }
  .qah-hero__status { max-width: none; }
  .qah-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .qa-handbook { padding-top: 24px; }
  .qah-grid { grid-template-columns: minmax(0, 1fr); }
  .qah-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qah-stats div { min-width: 0; padding: 10px 12px; }
  .qah-stats dd { font-size: 16px; }
  .qah-card, .qah-widget { padding: 16px; }
  .qah-pager { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .qah-switcher a { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .qa-handbook * { transition: none !important; } }
