/* Fully scoped to the plugin mount. Follows docs/DESIGN.md: production APOLLO look with AA-safe colours. Font family comes from the host theme. */
.apollo-quiz {
  --aq-text: #54595f; --aq-heading: #0f172a; --aq-label: #111827;
  --aq-accent: #4a6b37; --aq-accent-hover: #3e5a2e; --aq-secondary: #3d6584;
  --aq-focus: #046bd2; --aq-control: #6f8a60; --aq-rule: #8baa76;
  --aq-pale: #edfbe2; --aq-subtle: #d5ead8; --aq-radius: 4px; --aq-card-radius: 8px;
  --aq-shadow: rgba(0, 0, 0, .05) 0 1px 2px 0;
  font-family: inherit; color: var(--aq-text); background: #fff; border-radius: var(--aq-card-radius);
  box-shadow: rgba(0, 0, 0, .5) 0 0 10px 0; margin: 2rem 0; font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere;
}
.apollo-quiz *, .apollo-quiz *::before, .apollo-quiz *::after { box-sizing: border-box; }
.apollo-quiz .aq-body { padding: clamp(1rem, 4vw, 2.5rem); }
.apollo-quiz .aq-heading, .apollo-quiz h3, .apollo-quiz h4, .apollo-quiz legend { font-family: inherit; font-weight: 600; color: var(--aq-heading); }
.apollo-quiz .aq-heading { font-size: clamp(1.5rem, 3vw, 1.875rem); line-height: 1.3; letter-spacing: normal; margin: .5rem 0 1.25rem; }
.apollo-quiz h3 { font-size: 1.25rem; line-height: 1.3; margin: 1rem 0; }
.apollo-quiz h4 { font-size: 1.125rem; line-height: 1.3; margin: 1.2rem 0 .4rem; }
.apollo-quiz .aq-eyebrow { color: var(--aq-accent); font-size: .875rem; font-weight: 600; letter-spacing: .9px; text-transform: uppercase; margin: 0 0 .5rem; }
.apollo-quiz .aq-note { background: var(--aq-pale); padding: 1rem 1.25rem; border-left: 3px solid var(--aq-rule); border-radius: 0 var(--aq-radius) var(--aq-radius) 0; margin: 1.5rem 0; }
.apollo-quiz .aq-note p { margin: .75rem 0; }
.apollo-quiz .aq-metadata { display: grid; grid-template-columns: minmax(5rem, 1fr) minmax(0, 3fr); gap: .35rem 1rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--aq-rule); }
.apollo-quiz dt { font-weight: 600; color: var(--aq-label); }
.apollo-quiz dd { margin: 0; }
.apollo-quiz .aq-button { appearance: none; background: var(--aq-accent); border: 2px solid var(--aq-accent); border-radius: var(--aq-radius); box-shadow: var(--aq-shadow); color: #fff; cursor: pointer; font: inherit; font-size: 1rem; font-weight: 500; line-height: 1.2; min-height: 44px; padding: 13px 28px; margin: .4rem .5rem .4rem 0; white-space: normal; max-width: 100%; text-align: center; text-decoration: none; }
.apollo-quiz .aq-button:hover { background: var(--aq-accent-hover); border-color: var(--aq-accent-hover); color: #fff; }
.apollo-quiz a.aq-button { display: inline-block; }
.apollo-quiz .aq-secondary { background: #fff; border-color: var(--aq-secondary); color: var(--aq-secondary); box-shadow: none; }
.apollo-quiz .aq-secondary:hover { background: var(--aq-secondary); border-color: var(--aq-secondary); color: #fff; }
.apollo-quiz .aq-button:disabled { background: #eef0ec; color: #4b5249; border-color: var(--aq-control); box-shadow: none; cursor: default; }
.apollo-quiz :focus-visible { outline: 3px solid var(--aq-focus); outline-offset: 3px; }
/* Screen headings receive programmatic focus on every screen change (for keyboard and screen-reader users); they are not controls, so no ring. */
.apollo-quiz .aq-heading:focus, .apollo-quiz .aq-heading:focus-visible { outline: none; }
.apollo-quiz .aq-return { display: block; color: var(--aq-accent); text-decoration: underline; text-underline-offset: .2em; width: fit-content; padding-block: .65rem; margin-top: 1rem; }
.apollo-quiz .aq-return:hover { color: var(--aq-accent-hover); text-decoration-thickness: 2px; }
.apollo-quiz progress { display: block; width: 100%; height: .5rem; accent-color: var(--aq-accent); margin: 1rem 0 2rem; }
.apollo-quiz .aq-controls { border: 0; padding: 0; margin: 0; min-width: 0; }
.apollo-quiz legend { font-size: 1.25rem; line-height: 1.3; padding: 0; margin-bottom: 1rem; }
/* Astra sets label/legend to 14px/500 #111827; keep learner text at body size. */
.apollo-quiz label { font-size: 1rem; line-height: 1.5; font-weight: 400; color: var(--aq-text); }
.apollo-quiz .aq-choice, .apollo-quiz .aq-confirm { display: flex; align-items: flex-start; gap: .75rem; min-height: 44px; padding: .85rem 1rem; border: 1px solid var(--aq-control); border-radius: var(--aq-radius); box-shadow: var(--aq-shadow); margin-bottom: .6rem; cursor: pointer; }
.apollo-quiz .aq-choice:hover { border-color: var(--aq-accent); }
.apollo-quiz .aq-choice:has(input:checked) { background: var(--aq-pale); border-color: var(--aq-accent); box-shadow: inset 0 0 0 1px var(--aq-accent); }
.apollo-quiz input[type=checkbox], .apollo-quiz input[type=radio] { accent-color: var(--aq-accent); flex: 0 0 auto; width: 1.2rem; height: 1.2rem; margin: .2rem 0 0; }
.apollo-quiz .aq-board { display: grid; gap: 1rem; }
.apollo-quiz .aq-zone { border: 2px dashed var(--aq-control); border-radius: var(--aq-card-radius); padding: .5rem 1rem 1rem; background: #fff; }
.apollo-quiz .aq-bucket { background: var(--aq-pale); }
.apollo-quiz .aq-buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.apollo-quiz .aq-picking .aq-zone { border-style: solid; border-color: var(--aq-accent); }
.apollo-quiz .aq-zone.aq-over, .apollo-quiz .aq-bank.aq-over, .apollo-quiz .aq-gap.aq-over { border-style: solid; border-color: var(--aq-focus); background: #e8f1fb; }
.apollo-quiz .aq-zone-target { appearance: none; display: block; width: 100%; min-height: 44px; margin: 0 0 .5rem; padding: .5rem 0; background: transparent; border: 0; border-radius: var(--aq-radius); box-shadow: none; color: var(--aq-heading); cursor: pointer; font: inherit; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; text-align: start; }
.apollo-quiz .aq-zone-target:hover { background: transparent; color: var(--aq-accent); text-decoration: underline; }
.apollo-quiz .aq-pieces, .apollo-quiz .aq-bank { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; min-height: 44px; }
.apollo-quiz .aq-pieces li, .apollo-quiz .aq-bank li { margin: 0; max-width: 100%; }
.apollo-quiz .aq-empty { align-self: center; color: var(--aq-text); font-style: italic; }
.apollo-quiz .aq-piece { appearance: none; display: inline-flex; align-items: center; gap: .6rem; max-width: 100%; min-height: 44px; margin: 0; padding: .5rem .9rem .5rem .7rem; background: #fff; border: 1px solid var(--aq-control); border-radius: var(--aq-radius); box-shadow: rgba(0, 0, 0, .12) 0 1px 3px; color: var(--aq-heading); cursor: grab; font: inherit; font-size: 1rem; font-weight: 400; line-height: 1.3; text-align: start; touch-action: none; user-select: none; -webkit-user-select: none; white-space: normal; }
.apollo-quiz .aq-piece:hover { background: #fff; border-color: var(--aq-accent); color: var(--aq-heading); }
.apollo-quiz .aq-piece[aria-pressed=true] { background: var(--aq-accent); border: 2px solid var(--aq-accent-hover); color: #fff; box-shadow: rgba(0, 0, 0, .25) 0 3px 8px; }
.apollo-quiz .aq-piece[aria-pressed=true] .aq-grip { --aq-grip: #fff; }
.apollo-quiz .aq-grip { --aq-grip: var(--aq-control); flex: 0 0 auto; width: 10px; height: 16px; background-image: radial-gradient(circle, var(--aq-grip) 1.5px, transparent 1.75px); background-size: 5px 5px; }
.apollo-quiz .aq-dragging { opacity: .4; }
.apollo-quiz .aq-board-count { margin: 0; font-weight: 600; color: var(--aq-label); }
.apollo-quiz .aq-blank { padding: 1rem 0; border-bottom: 1px solid var(--aq-subtle); }
.apollo-quiz .aq-sentence { margin: 0 0 .75rem; color: var(--aq-heading); font-size: 1.0625rem; line-height: 2.6; }
.apollo-quiz .aq-gap { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-width: 8rem; min-height: 44px; margin: 0 .3rem; padding: .25rem .9rem; vertical-align: middle; background: var(--aq-pale); border: 2px dashed var(--aq-control); border-radius: var(--aq-radius); box-shadow: none; color: var(--aq-heading); cursor: pointer; font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.apollo-quiz .aq-gap:hover { background: var(--aq-pale); border-color: var(--aq-accent); color: var(--aq-heading); }
.apollo-quiz .aq-gap.aq-filled { background: #fff; border-style: solid; border-color: var(--aq-accent); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.apollo-quiz .aq-bank.aq-over { border: 2px solid var(--aq-focus); border-radius: var(--aq-radius); }
/* Drag ghost lives on <body> so host transforms cannot offset it. */
.aq-ghost { position: fixed; left: 0; top: 0; z-index: 100000; pointer-events: none; max-width: min(18rem, 80vw); padding: .5rem .9rem; background: #fff; border: 2px solid #4a6b37; border-radius: 4px; box-shadow: rgba(0, 0, 0, .3) 0 6px 16px; color: #0f172a; font-size: 1rem; line-height: 1.3; }
.apollo-quiz input[type=range] { width: 100%; min-height: 44px; accent-color: var(--aq-accent); margin: 1rem 0; }
.apollo-quiz .aq-slider-value { font-size: 1.25rem; font-weight: 600; color: var(--aq-heading); }
.apollo-quiz .aq-actions { border-top: 1px solid var(--aq-rule); padding-top: 1rem; margin-top: 2rem; display: flex; flex-wrap: wrap; }
.apollo-quiz .aq-review-list { padding-left: 1.5rem; }
.apollo-quiz .aq-review-list li { padding-left: .25rem; }
.apollo-quiz .aq-review-list button { font-size: .9375rem; padding: 10px 20px; }
.apollo-quiz .aq-score { background: var(--aq-pale); border-radius: var(--aq-card-radius); padding: 1.5rem; margin: 1.5rem 0; }
.apollo-quiz .aq-score p { margin: .25rem 0; }
.apollo-quiz .aq-score-total { font-family: inherit; font-weight: 600; color: var(--aq-heading); font-size: clamp(1.875rem, 5vw, 2.625rem); line-height: 1.3; }
.apollo-quiz .aq-result { border-top: 1px solid var(--aq-rule); padding: 2rem 0; }
.apollo-quiz .aq-credit { font-weight: 600; color: var(--aq-label); }
.apollo-quiz .aq-summary { border-left: 3px solid var(--aq-rule); padding-left: 1rem; }
.apollo-quiz .aq-answer-list { padding-left: 1.5rem; }
.apollo-quiz .aq-filled-word { color: var(--aq-heading); font-weight: 600; text-decoration: underline; text-decoration-color: var(--aq-rule); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.apollo-quiz .aq-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 480px) { .apollo-quiz .aq-metadata { grid-template-columns: 1fr; } .apollo-quiz dd { margin-bottom: .5rem; } .apollo-quiz .aq-button { width: 100%; margin-right: 0; } }
@media (prefers-reduced-motion: reduce) { .apollo-quiz *, .apollo-quiz *::before, .apollo-quiz *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
/* Feature 009: automatic quiz route context line and group link lists. Typography comes from the host theme. */
.apollo-quiz-route__context { color: #3d6584; font-weight: 600; }
.apollo-quiz-group { margin: 2rem 0; }
.apollo-quiz-group__list { padding-left: 1.25rem; }
.apollo-quiz-group__list li { margin: .35rem 0; }
.apollo-quiz-group__list a { text-decoration: underline; text-underline-offset: .15em; }
.apollo-quiz-message--admin { font-style: italic; }
