/* AdaptEd Sheet player (sheet-player.js) on /Work/{code}.
   Colours come from the Work page's own --w-* tokens, defined for light AND
   dark there: no literal backgrounds, so neither theme gets dark-on-dark. */

.sp-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px; align-items: start; }
.sp-passage { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.sp-passage summary { font-weight: 700; cursor: pointer; margin-bottom: 10px; }
.sp-passage-eyebrow { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--w-muted); }
.sp-passage-title { display: inline; font-size: 1.3rem; font-weight: 800; line-height: 1.25; color: var(--w-text); }
.sp-passage p { line-height: 1.7; font-size: 1.02rem; }
/* A paragraph's heading, like a textbook section heading (SheetPassage.Headings). */
.sp-passage-heading { font-size: 1.05rem; font-weight: 800; margin: 14px 0 4px; color: var(--w-text); }
/* Key words, bold the first time they appear (SheetPassageText). */
.sp-passage p strong { font-weight: 700; color: var(--w-text); }
/* A paragraph's picture: under its words, never wider than the passage or taller than 300px. */
.sp-passage-fig { margin: -4px 0 14px; text-align: center; }
.sp-passage-img { display: inline-block; max-width: 100%; max-height: 440px; height: auto; object-fit: contain; border: 1px solid var(--w-border); border-radius: 8px; cursor: zoom-in; }
.sp-work { min-width: 0; }
/* Independent practice: no passage, so the work is one centered column, about
   as wide as beside a passage (full width blew a picture up to 800px tall). */
.sp-layout.no-passage { grid-template-columns: minmax(0, 1fr); max-width: 1040px; margin: 0 auto; }
/* Two or three standards: the passage in parts, each above the items on its
   standard (a section card, a question, an Apply problem), in the flow. */
.sp-passage.sp-part { position: static; max-height: none; overflow: visible; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--w-border); border-left: 4px solid var(--w-accent); border-radius: 10px; background: var(--w-card); }
.sp-passage.sp-part:not([open]) summary { margin-bottom: 0; }
.sp-passage.sp-part .sp-passage-title { font-size: 1.1rem; }
/* A later section on a part already shown: a link back up to it, never a second copy. */
.sp-passage.sp-part { scroll-margin-top: 12px; }
.sp-reread { display: inline-block; margin: 0 0 10px; padding: 5px 12px; border: 1px solid var(--w-border); border-radius: 999px; background: var(--w-card); color: var(--w-accent); font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.sp-reread:hover { border-color: var(--w-accent); }
.sp-section .sp-reread { margin-top: 4px; }

.sp-section { margin-bottom: 16px; }
.sp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sp-title { font-size: 1.1rem; margin: 0 0 4px; }
.sp-points { color: var(--w-muted); font-size: .85rem; white-space: nowrap; }
.sp-directions { color: var(--w-muted); margin: 0 0 12px; }
.sp-note { color: var(--w-tip); background: var(--w-tip-soft); border: 1px solid var(--w-tip-border); border-radius: 8px; padding: 8px 10px; }

.sp-select { padding: 6px 8px; border: 1px solid var(--w-border); border-radius: 8px; background: var(--w-card); color: var(--w-text); font: inherit; max-width: 100%; }

/* Sort */
.sp-tray, .sp-col { border: 1px dashed var(--w-border); border-radius: 10px; padding: 8px; background: var(--w-bg); }
.sp-tray { margin-bottom: 10px; }
.sp-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.sp-col-h { display: block; width: 100%; font-weight: 700; font-size: .9rem; margin-bottom: 6px; text-align: left; border: 0; background: none; color: var(--w-accent); padding: 0; cursor: pointer; }
.sp-tray > .sp-col-h { color: var(--w-muted); cursor: default; }
.sp-col-list { display: flex; flex-direction: column; gap: 6px; min-height: 36px; }
.sp-card { border: 1px solid var(--w-border); border-radius: 8px; padding: 8px; background: var(--w-card); cursor: pointer; }
.sp-card.is-selected { outline: 3px solid var(--w-accent); }
.sp-card:focus-visible { outline: 3px solid var(--w-accent); }
.sp-card .sp-select { margin-top: 6px; width: 100%; font-size: .85rem; }
/* A picture card: the picture is what students sort, so it gets the room. */
.sp-card-img { display: block; width: 100%; max-height: 190px; object-fit: contain; border-radius: 6px; background: #fff; user-select: none; }
.sp-card.has-picture .sp-card-text { margin-top: 4px; font-size: .85rem; text-align: center; }
.sp-card.is-right { border-color: var(--w-correct); background: var(--w-correct-soft); }
.sp-card.is-wrong { border-color: var(--w-wrong); background: var(--w-wrong-soft); }

/* Label */
/* The stage shrinks to the picture, so a tall picture is capped at the screen and the spots (in % of the stage) stay on it. */
.sp-stage { position: relative; border: 1px solid var(--w-border); border-radius: 8px; overflow: hidden; width: fit-content; max-width: 100%; margin: 0 auto; }
.sp-img { display: block; width: auto; max-width: 100%; max-height: 78vh; height: auto; }
.sp-spot {
    position: absolute; transform: translate(-50%, -50%); aspect-ratio: 1 / 1; min-width: 26px;
    border-radius: 50%; border: 3px solid var(--w-accent); background: var(--w-card);
    color: var(--w-accent); font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.sp-spot.is-rect { transform: none; aspect-ratio: auto; border-radius: 6px; background: transparent; }
/* An arrow spot: a fixed-size numbered tag; the arrow itself is in .sp-lines. */
.sp-spot.is-arrow { width: 30px; height: 30px; min-width: 30px; font-size: .9rem; }
.sp-lines { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.sp-spot.is-filled { background: var(--w-accent); color: #fff; }
.sp-spot.is-right { border-color: var(--w-correct); }
.sp-spot.is-wrong { border-color: var(--w-wrong); }
/* A box spot's number: a solid badge at its center, readable on any picture.
   Filling the box would hide the picture, so "answered" shows on the badge. */
.sp-spot-num {
    box-sizing: border-box; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 999px;
    border: 2px solid currentColor; background: var(--w-card); color: var(--w-accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .9rem; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.sp-spot.is-rect.is-filled { background: transparent; }
.sp-spot.is-rect.is-filled .sp-spot-num { background: var(--w-accent); border-color: var(--w-accent); color: #fff; }
.sp-spot.is-rect.is-right .sp-spot-num { border-color: var(--w-correct); }
.sp-spot.is-rect.is-wrong .sp-spot-num { border-color: var(--w-wrong); }
.sp-bank { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-bank-h { font-weight: 700; font-size: .9rem; }
.sp-bank-note { flex-basis: 100%; font-size: .85rem; font-style: italic; opacity: .8; }
.sp-chip { border: 1px solid var(--w-border); border-radius: 999px; padding: 2px 10px; font-size: .85rem; background: var(--w-bg); }
.sp-spots { padding-left: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.sp-spot-row { display: flex; align-items: center; gap: 8px; }
.sp-spot-label { min-width: 64px; font-weight: 600; }
.sp-spot-row.is-right .sp-select { border-color: var(--w-correct); background: var(--w-correct-soft); }
.sp-spot-row.is-wrong .sp-select { border-color: var(--w-wrong); background: var(--w-wrong-soft); }

/* Questions */
.sp-question { margin-bottom: 14px; }
.sp-q-text { font-weight: 600; margin-bottom: 6px; }
.sp-choice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--w-border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.sp-choice.is-picked { border-color: var(--w-accent); background: var(--w-accent-soft); }
.sp-choice.is-right { border-color: var(--w-correct); background: var(--w-correct-soft); }
.sp-choice.is-wrong { border-color: var(--w-wrong); background: var(--w-wrong-soft); }
.sp-letter { font-weight: 700; }
.sp-written { width: 100%; padding: 8px 10px; border: 1px solid var(--w-border); border-radius: 8px; background: var(--w-card); color: var(--w-text); font: inherit; }

.sp-mark { font-weight: 700; margin-left: 6px; }
.is-right > .sp-mark { color: var(--w-correct); }
.is-wrong > .sp-mark { color: var(--w-wrong); }
.sp-pending { color: var(--w-neutral); font-weight: 600; font-size: .85rem; }
.sp-worth { color: var(--w-muted); font-size: .85rem; margin-top: 4px; }

@media (max-width: 860px) {
    .sp-layout { grid-template-columns: minmax(0, 1fr); }
    .sp-passage { position: static; max-height: none; }
}

/* Supports (a student's accommodation grants; SheetSupports). */
.sp-say { border: 1px solid var(--w-border); background: var(--w-card); color: var(--w-text); border-radius: 999px; width: 28px; height: 28px; padding: 0; margin-right: 6px; font-size: .85rem; line-height: 1; cursor: pointer; vertical-align: middle; }
.sp-say:hover, .sp-say:focus-visible { border-color: var(--w-accent); outline: none; }
.sp-say.is-speaking { background: var(--w-accent); color: #fff; border-color: var(--w-accent); }
.sp-q-text .sp-say { margin: 0 0 0 6px; }
.sp-keyword-list dt .sp-say { margin: 0 0 0 6px; width: 24px; height: 24px; }
/* The whole passage, beside its title; the sheet's name in the page header. */
.sp-passage summary .sp-say { margin: 0 0 0 8px; }
.w-head-row h1 .sp-say { width: 32px; height: 32px; margin: 0 8px 0 0; font-size: 1rem; }
.sp-spot-row > .sp-say { flex: 0 0 auto; margin: 0; }
.ai-step-label .sp-say, .ai-blank-label .sp-say { width: 24px; height: 24px; font-size: .75rem; }
.sp-keywords { margin-bottom: 16px; }
.sp-keywords summary { font-weight: 700; cursor: pointer; }
.sp-keyword-list { margin: 8px 0 0; }
.sp-keyword-list dt { font-weight: 700; }
.sp-keyword-list dd { margin: 0 0 8px; color: var(--w-muted); }
.sp-starters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.sp-starters-h { font-weight: 700; font-size: .85rem; }
.sp-starter { border: 1px solid var(--w-border); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .85rem; background: var(--w-bg); color: var(--w-text); cursor: pointer; }
.sp-starter:hover, .sp-starter:focus-visible { border-color: var(--w-accent); outline: none; }

/* Zoom (sheet-player.js openZoom): full screen over the page, − / + / Fit. */
.sp-zoom { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: rgba(15, 23, 42, .92); }
.sp-zoom-bar { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 12px; }
.sp-zoom-tool { border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; border-radius: 8px; min-width: 40px; padding: 6px 12px; font: inherit; font-weight: 700; cursor: pointer; }
.sp-zoom-tool:disabled { opacity: .4; cursor: default; }
.sp-zoom-tool:focus-visible { outline: 3px solid #93c5fd; }
.sp-zoom-area { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: flex; align-items: flex-start; justify-content: center; }
.sp-zoom-holder { flex: none; margin: auto; }
.sp-zoom-holder .sp-zoom-img { display: block; width: 100%; height: auto; background: #fff; border-radius: 6px; }
.sp-zoom-holder .sp-stage { width: 100%; max-width: none; margin: 0; background: #fff; }
.sp-zoom-holder .sp-img { width: 100%; max-width: none; max-height: none; }
.sp-zoom-holder .sp-stage .sp-spot { pointer-events: none; }
body.sp-zoom-open { overflow: hidden; }
/* The buttons that open it. */
.sp-zoom-open { display: block; margin: 8px auto 0; border: 1px solid var(--w-border); background: var(--w-card); color: var(--w-text); border-radius: 999px; padding: 4px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.sp-zoom-open:hover, .sp-zoom-open:focus-visible { border-color: var(--w-accent); outline: none; }
.sp-card { position: relative; }
.sp-zoom-btn { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--w-border); background: var(--w-card); color: var(--w-text); padding: 0; font-size: .85rem; cursor: zoom-in; }
.sp-zoom-btn:hover, .sp-zoom-btn:focus-visible { border-color: var(--w-accent); outline: none; }

/* Spanish peek (53): its "Español" button, above the sheet. The bubble and card are pod-spanish-peek.css. */
.sp-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.sp-peek-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--w-border); border-radius: 999px; background: var(--w-card); color: var(--w-text); font: inherit; font-weight: 600; cursor: pointer; }
.sp-peek-btn:hover, .sp-peek-btn:focus-visible { border-color: var(--w-accent); outline: none; }
.sp-peek-btn.a11y-toolbar-active { border-color: var(--w-accent); color: var(--w-accent); }
.sp-peek-btn.a11y-toolbar-hint { box-shadow: 0 0 0 3px var(--w-accent-soft); }
.sp-peek-btn.sp-paused { opacity: .6; }
.sp-peek-btn::before { content: "🌐"; }


/* A question's data table (2026-11-21), and the "select more than one" hint. */
.sp-data-wrap { overflow-x: auto; margin: 6px 0 8px; }
.sp-data-table { border-collapse: collapse; font-size: .92rem; min-width: 60%; }
.sp-data-table th, .sp-data-table td { border: 1px solid #cbd5e1; padding: 4px 8px; text-align: left; vertical-align: top; }
.sp-data-table th { background: #f1f5f9; font-weight: 700; }
.sp-multi-hint { font-size: .85rem; font-style: italic; color: #475569; margin: 2px 0 4px; }
[data-theme="dark"] .sp-data-table th, [data-theme="dark"] .sp-data-table td { border-color: rgba(255,255,255,.18); }
[data-theme="dark"] .sp-data-table th { background: rgba(255,255,255,.06); }
[data-theme="dark"] .sp-multi-hint { color: #a8a8a8; }
