/* Prediction reading lesson: one shared component language across three surfaces. */
html[data-theme] .pred-teacher-grid,
html[data-theme] .pred-report-grid {display:grid;grid-template-columns:minmax(0,1.6fr) minmax(290px,.8fr);gap:18px;align-items:start}
html[data-theme] .pred-teacher-side {display:grid;gap:18px;min-width:0}
html[data-theme] .pred-teacher-grid .panel,
html[data-theme] .pred-report-grid .panel {padding:22px;min-width:0}
html[data-theme] .pred-teacher-grid h2,
html[data-theme] .pred-report-grid h2 {font-size:21px;margin:0 0 12px}
html[data-theme] .pred-teacher-grid p,
html[data-theme] .pred-report-grid p {line-height:1.65}
html[data-theme] .pred-section-head {display:flex;justify-content:space-between;gap:14px;align-items:start;margin-bottom:20px}
html[data-theme] .pred-section-head p {margin:0;color:var(--muted)}
html[data-theme] .pred-editor .pred-section-head .tag {flex-shrink:0;white-space:nowrap}
html[data-theme] .pred-student-network {font-size:1rem;line-height:1.5}
html[data-theme] .pred-student-network:empty {margin:0}
html[data-theme] .pred-field {display:grid;gap:7px;margin-bottom:14px;min-width:0}
html[data-theme] .pred-field span {font-weight:750;color:var(--ink)}
html[data-theme] .pred-field :is(input,textarea,select) {width:100%;max-width:100%;margin:0;font:inherit;line-height:1.5;padding:10px 12px}
html[data-theme] .pred-field textarea {resize:vertical;min-height:80px}
html[data-theme] .pred-three {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
html[data-theme] .pred-short {max-width:300px}
html[data-theme] .pred-edit-details {border-top:1px solid var(--line);margin:18px 0;padding:14px 0 0}
html[data-theme] .pred-edit-details summary {cursor:pointer;font-weight:800;font-size:16px;padding:5px 0;list-style:none}
html[data-theme] .pred-edit-details summary::after {content:'⌄';float:right;color:var(--green)}
html[data-theme] .pred-edit-details[open] summary::after {content:'⌃'}
html[data-theme] .pred-editor-story {padding-top:15px}
html[data-theme] .pred-editor-story h3 {margin:0 0 14px;font-size:18px}
html[data-theme] .pred-editor-hint {color:var(--muted);font-size:13px;margin:2px 0 0}
html[data-theme] .pred-task-preview {border-top:1px solid var(--line);padding-top:20px;margin-top:18px}
html[data-theme] .pred-task-preview h2 {margin-bottom:14px}
html[data-theme] .pred-task-preview p {margin:7px 0;line-height:1.55}
html[data-theme] .pred-task-preview p b {display:inline-grid;place-items:center;width:23px;height:23px;margin-right:9px;border-radius:4px;background:var(--mint);color:var(--green);font-size:13px}
html[data-theme] .pred-task-preview strong {display:block;margin-top:12px;color:var(--green)}
html[data-theme] .pred-task-preview .pred-task-new-clue {margin-top:15px;padding:9px 12px;background:var(--peach);border-left:4px solid var(--primary)}
html[data-theme] .pred-form-footer {display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding-top:16px;margin-top:20px}
html[data-theme] .pred-form-footer span {font-size:13px;color:var(--muted)}
html[data-theme] .pred-teacher-side .btn {width:100%;justify-content:center}
html[data-theme] .pred-teacher-side .section-head {flex-wrap:wrap;gap:8px;margin-bottom:8px}
html[data-theme] .pred-teacher-side .section-head h2 {margin:0}
html[data-theme] .pred-teacher-side .section-head .btn {width:auto}
html[data-theme] .pred-row {display:flex;justify-content:space-between;gap:14px;align-items:center;text-decoration:none;color:var(--ink);padding:12px 0;border-bottom:1px solid var(--line);min-height:54px}
html[data-theme] .pred-row:last-child {border-bottom:0}
html[data-theme] .pred-row strong {color:var(--green);white-space:nowrap;font-size:13px}
html[data-theme] .pred-targets {border:1px solid var(--line);border-radius:var(--control-radius);padding:14px;margin:12px 0;min-width:0}
html[data-theme] .pred-target-group + .pred-target-group {border-top:1px solid var(--line);margin-top:12px;padding-top:12px}
html[data-theme] .pred-target-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr));gap:8px}
html[data-theme] .pred-publish-roster {max-height:min(40vh,360px);overflow:auto;padding-inline-start:18px}
html[data-theme] .pred-publish-roster p {margin:3px 0 12px;overflow-wrap:anywhere}
html[data-theme] .pred-targets legend {padding:0 7px;font-weight:800}
html[data-theme] .pred-target {display:flex;align-items:center;gap:8px;padding:10px;border:1px solid var(--line);border-radius:var(--control-radius);min-height:48px}
html[data-theme] .pred-target input {width:20px;min-height:20px;margin:0;accent-color:var(--primary)}
html[data-theme] .pred-target span {font-weight:650}
html[data-theme] .pred-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0 18px}
html[data-theme] .pred-metrics > div {background:var(--surface-soft);border:1px solid var(--line);padding:14px 10px;text-align:center;border-radius:var(--control-radius)}
html[data-theme] .pred-metrics strong {display:block;font-size:27px;color:var(--green);line-height:1.2}
html[data-theme] .pred-metrics span {font-size:12px;color:var(--muted)}
html[data-theme] .pred-report-student {padding:12px 0;border-bottom:1px solid var(--line);display:grid;gap:4px}
html[data-theme] .pred-report-student span {font-size:13px;color:var(--muted)}
html[data-theme] .pred-report-seats {display:grid;gap:12px}
html[data-theme] .pred-report-seat {background:var(--surface-soft);border:1px solid var(--line);padding:16px;border-radius:var(--control-radius)}
html[data-theme] .pred-report-seat h3 {margin:0 0 10px;font-size:18px}
html[data-theme] .pred-report-seat p {margin:4px 0;display:grid;grid-template-columns:60px minmax(0,1fr);gap:6px}
html[data-theme] .pred-report-seat p b {color:var(--green)}
html[data-theme] .pred-report-seat > span {display:inline-block;margin-top:8px;font-size:12px;color:var(--muted)}
html[data-theme] .pred-followup-actions {display:grid;gap:8px}
html[data-theme] .pred-phase-grid,
html[data-theme] .pred-student-phase-results {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,138px),1fr));gap:8px}
html[data-theme] .pred-phase-metric {display:grid;gap:5px;padding:12px;background:var(--surface-soft);border-left:3px solid var(--green);border-radius:var(--control-radius)}
html[data-theme] .pred-phase-metric h3 {font-size:15px;margin:0}
html[data-theme] .pred-phase-metric strong {font-size:18px;color:var(--green)}
html[data-theme] .pred-phase-metric span {font-size:13px;color:var(--muted)}
html[data-theme] .pred-report-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
html[data-theme] .pred-report-actions .btn {width:auto}
html[data-theme] .pred-draft-actions .pred-report-actions:first-child {margin-top:0}
@media(min-width:1001px){html[data-theme] .pred-draft-actions{position:sticky;top:16px}}
html[data-theme] .pred-report-task + .pred-report-task {margin-top:18px;padding-top:8px;border-top:1px solid var(--line)}
html[data-theme] .pred-report-task .pred-row {border-bottom:0}
html[data-theme] .pred-student-phase-results b {display:block;color:var(--ink);margin-bottom:3px}
html[data-theme] .pred-original-answers {margin:4px 0}
html[data-theme] .pred-original-answers summary,
html[data-theme] .pred-task-settings > summary {font-weight:750;color:var(--green);cursor:pointer}
html[data-theme] .pred-task-settings > summary {font-size:18px}
html[data-theme] .pred-task-settings form {margin-top:16px}
html[data-theme] .pred-record-answer {padding:10px 0;border-bottom:1px solid var(--line)}
html[data-theme] .pred-record-answer dl {display:grid;grid-template-columns:76px minmax(0,1fr);gap:6px;margin:6px 0}
html[data-theme] .pred-record-answer dt {color:var(--muted)}
html[data-theme] .pred-record-answer dd {margin:0;overflow-wrap:anywhere}
html[data-theme] .pred-hint-fields {grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:650px){html[data-theme] .pred-hint-fields{grid-template-columns:1fr}html[data-theme] .pred-report-task .pred-row{flex-wrap:wrap}html[data-theme] .pred-report-task .pred-row strong{white-space:normal}}

html[data-theme] .pred-board {background:var(--bg);min-height:100dvh;display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:10px;padding:12px clamp(12px,2vw,30px);color:var(--ink)}
html[data-theme] .pred-board-top {display:flex;justify-content:space-between;align-items:center;gap:14px;min-height:48px}
html[data-theme] .pred-board-top > strong {font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme] .pred-board-top > div {display:flex;gap:8px}
html[data-theme] .pred-board-top .btn {min-height:44px}
html[data-theme] .pred-board-material {min-height:0;overflow:visible;background:var(--surface);border:1.5px solid var(--line);border-radius:var(--card-radius);padding:clamp(14px,1.4vw,22px);box-shadow:var(--shadow)}
html[data-theme] .pred-board-welcome {height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
html[data-theme] .pred-board-welcome h1 {font-size:clamp(32px,4vw,60px);margin:12px 0}
html[data-theme] .pred-board-welcome p {font-size:clamp(18px,2vw,27px);max-width:800px;line-height:1.55}
html[data-theme] .pred-stage-number {color:var(--primary-dark);font-size:15px;font-weight:900;letter-spacing:.12em}
html[data-theme] .pred-reading-head {display:flex;align-items:baseline;gap:18px;margin-bottom:4px}
html[data-theme] .pred-reading-head h1 {font-size:clamp(26px,3vw,38px);margin:0}
html[data-theme] .pred-sentences {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 16px;max-height:clamp(105px,18dvh,240px);overflow:auto;scrollbar-width:thin;scrollbar-color:var(--primary) var(--surface-soft);padding-inline-end:6px}
html[data-theme] .pred-board-reading > .pred-new-clue {display:flex;align-items:baseline;gap:8px;margin:6px 0 0;padding:5px 8px;font-size:clamp(19px,1.8vw,28px);line-height:1.3;font-weight:750;overflow-wrap:anywhere;max-height:clamp(64px,11dvh,160px);overflow:auto;scrollbar-width:thin;scrollbar-color:var(--primary) var(--surface-soft)}
html[data-theme] .pred-sentences p {font-size:clamp(19px,1.8vw,28px);font-weight:650;line-height:1.38;margin:0;display:flex;gap:8px;align-items:baseline;overflow-wrap:anywhere}
html[data-theme] .pred-sentences b,
html[data-theme] .pred-board-reading > .pred-new-clue b,
html[data-theme] .pred-student-reading b {display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;width:25px;height:25px;background:var(--mint);color:var(--green);font-size:13px;border-radius:4px}
html[data-theme] .pred-new-clue {width:100%;background:var(--peach);padding:8px 12px;border-left:4px solid var(--primary)}
html[data-theme] .pred-new-clue b {background:var(--primary);color:white}
html[data-theme] .pred-board-reading h2 {font-size:clamp(22px,2.5vw,32px);margin:8px 0 0;color:var(--green)}
html[data-theme] .pred-seat-scroll {min-width:0;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:var(--primary) var(--surface-soft)}
html[data-theme] .pred-seat-row {--pred-seat-basis:280px;display:flex;flex-wrap:nowrap;gap:10px;align-items:stretch;padding-bottom:5px}
html[data-theme] .pred-seat {flex:1 0 var(--pred-seat-basis);min-width:0;scroll-snap-align:start;display:flex;flex-direction:column;background:var(--surface);border:1.5px solid var(--line);border-radius:var(--card-radius);padding:14px;box-shadow:var(--shadow)}
@media(min-width:651px){html[data-theme] .pred-seat-row:has(.pred-seat:nth-child(2):last-child){--pred-seat-basis:300px}}
html[data-theme] .pred-seat-nav:not([hidden]) {display:flex;gap:6px}
html[data-theme] .pred-seat-nav .btn {min-width:44px;min-height:44px;font-size:15px}
html[data-theme] .pred-seat-nav [data-seat-visible] {color:var(--green);background:var(--mint);border-color:var(--green)}
html[data-theme] .pred-seat-head {display:flex;align-items:center;gap:9px;padding-bottom:8px;border-bottom:1px solid var(--line);margin-bottom:10px}
html[data-theme] .pred-seat-head b {display:grid;place-items:center;background:var(--green);color:white;width:30px;height:30px;border-radius:4px;font-size:13px}
html[data-theme] .pred-seat-head h3 {font-size:clamp(19px,1.25vw,24px);margin:0;flex:1;overflow-wrap:anywhere}
html[data-theme] .pred-seat-head > span {color:var(--green);font-size:22px;font-weight:900}
html[data-theme] .pred-options {display:grid;gap:7px;margin-bottom:8px}
html[data-theme] .pred-revision-options {grid-template-columns:repeat(2,minmax(0,1fr))}
html[data-theme] .pred-evidence-options {display:flex;flex-wrap:wrap;gap:5px}
html[data-theme] .pred-evidence-options .pred-choice {min-width:44px;min-height:44px;text-align:center;padding:6px 9px}
html[data-theme] .pred-choice,
html[data-theme] .pred-student-option {border:1.5px solid var(--edge);background:var(--surface);color:var(--ink);border-radius:var(--control-radius);text-align:left;min-height:43px;padding:8px 12px;font:inherit;font-weight:700;line-height:1.4;cursor:pointer;touch-action:manipulation}
html[data-theme] .pred-choice {font-size:clamp(16px,1.15vw,22px);min-height:46px;overflow-wrap:anywhere}
html[data-theme] .pred-choice:hover,
html[data-theme] .pred-student-option:hover {border-color:var(--green);background:var(--mint)}
html[data-theme] .pred-choice.chosen,
html[data-theme] .pred-student-option.chosen {border-color:var(--primary);background:var(--peach);box-shadow:inset 4px 0 0 var(--primary)}
html[data-theme] .pred-prior {background:var(--mint);padding:8px 10px;font-size:15px;line-height:1.4;margin:0 0 8px}
html[data-theme] .pred-board .pred-prior,html[data-theme] .pred-inline-label {font-size:clamp(15px,1vw,19px)}
html[data-theme] .pred-inline-label {display:block;margin:0 0 4px}
html[data-theme] .pred-seat-submit {width:100%;min-height:46px;font-size:clamp(16px,1vw,19px);margin-top:auto}
html[data-theme] .pred-submitted {display:grid;place-items:center;min-height:125px;color:var(--green);font-size:18px;font-weight:800;text-align:center;background:var(--mint);padding:10px}
html[data-theme] .pred-trail p {padding:8px 10px;background:var(--surface-soft);margin:0 0 6px;font-size:16px;line-height:1.5}
html[data-theme] .pred-board-footer {display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid var(--line);padding:9px 0;min-height:66px}
html[data-theme] .pred-board-footer strong {font-size:18px}
html[data-theme] .pred-board-connection:empty {display:none}
html[data-theme] .pred-board-connection:not(:empty) {position:sticky;top:0;z-index:2;padding:8px 12px;background:var(--peach);border-left:4px solid var(--primary);font-size:15px;line-height:1.4;color:var(--ink);font-weight:750}
html[data-theme] dialog[open]:has(#pred-unlock-form) {display:flex;flex-direction:column;position:fixed;inset:auto;top:var(--pred-unlock-center-y,50dvh);left:var(--pred-unlock-center-x,50%);transform:translate(-50%,-50%);margin:0;width:min(440px,calc(var(--pred-unlock-width,100vw) - 24px));max-height:calc(var(--pred-unlock-height,100dvh) - 20px);overflow:hidden}
html[data-theme] dialog:has(#pred-unlock-form) .modal-head {flex:none;padding:10px 16px}
html[data-theme] dialog:has(#pred-unlock-form) .modal-body {min-height:0;overflow:auto;padding:12px 16px;overscroll-behavior:contain}
html[data-theme] #pred-unlock-form .form-actions {margin:10px 0 0}
html[data-theme] #pred-unlock-form .btn {min-height:44px}

html[data-theme] .pred-student-page {max-width:850px;margin:0 auto;padding-bottom:40px}
html[data-theme] .pred-student-top {display:flex;justify-content:space-between;align-items:center;gap:14px;margin:15px 0}
html[data-theme] .pred-student-top > span {color:var(--green);font-weight:900}
html[data-theme] .pred-progress {height:8px;background:var(--line);border-radius:3px;overflow:hidden;margin-bottom:18px}
html[data-theme] .pred-progress > span {display:block;height:100%;background:var(--primary);transition:width .25s}
html[data-theme] .pred-student-card {--pred-student-font-extra:0px;background:var(--surface);border:1.5px solid var(--line);border-radius:var(--card-radius);box-shadow:var(--shadow);padding:clamp(18px,3vw,34px);font-size:calc(1em + var(--pred-student-font-extra))}
html[data-text-size="large"] .pred-student-card {--pred-student-font-extra:2px}
html[data-theme] .pred-student-card h1 {font-size:calc(clamp(26px,3vw,36px) + var(--pred-student-font-extra));margin:12px 0 18px}
html[data-theme] .pred-student-card h2 {font-size:calc(clamp(21px,2.4vw,28px) + var(--pred-student-font-extra));margin:16px 0}
html[data-theme] .pred-student-card h3 {font-size:calc(17px + var(--pred-student-font-extra));margin:16px 0 8px}
html[data-theme] .pred-student-reading {background:var(--surface-soft);border:1px solid var(--line);padding:16px;margin-bottom:16px}
html[data-theme] .pred-student-reading p {font-size:calc(clamp(18px,2vw,23px) + var(--pred-student-font-extra));line-height:1.65;margin:4px 0;display:flex;gap:10px;align-items:baseline}
html[data-theme] .pred-student-card .pred-prior {font-size:calc(15px + var(--pred-student-font-extra))}
html[data-theme] .pred-student-options {display:grid;gap:10px}
html[data-theme] .pred-student-option {min-height:54px;font-size:calc(18px + var(--pred-student-font-extra));padding:12px 16px}
html[data-theme] .pred-student-submit.btn.big {width:100%;margin-top:20px;font-size:calc(18px + var(--pred-student-font-extra))}
html[data-theme] .pred-feedback {padding:12px 14px;margin:14px 0;border-left:4px solid var(--green);background:var(--mint);font-size:16px;line-height:1.5}
html[data-theme] .pred-feedback.needs-work {border-color:var(--primary);background:var(--peach)}
html[data-theme] .pred-student-review p {font-size:calc(18px + var(--pred-student-font-extra));line-height:1.6;margin:10px 0}
html[data-theme] .pred-room-link {display:flex;align-items:end;gap:10px;margin:12px 0}
html[data-theme] .pred-room-link .pred-field {flex:1;margin:0}
html[data-theme] .pred-analytics-panel {margin:18px 0}
html[data-theme] .pred-analytics-details {margin-top:12px;border-top:1px solid var(--line);padding-top:12px}
html[data-theme] .pred-analytics-details summary {font-weight:800;color:var(--green);cursor:pointer}
html[data-theme] .pred-analytics-students {display:grid;gap:8px;margin-top:12px}
html[data-theme] .pred-analytics-students > div {display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
html[data-theme] .pred-analytics-students span {color:var(--muted);font-size:13px;text-align:right}
@media(max-width:1000px){html[data-theme] .pred-teacher-grid,html[data-theme] .pred-report-grid{grid-template-columns:1fr}}
@media(max-width:650px){html[data-theme] .pred-three{grid-template-columns:1fr}html[data-theme] .pred-form-footer{align-items:stretch;flex-direction:column}html[data-theme] .pred-board{padding:8px}html[data-theme] .pred-sentences{grid-template-columns:1fr}html[data-theme] .pred-board-top>strong{display:none}html[data-theme] .pred-board-footer .btn{font-size:14px;padding-inline:10px}html[data-theme] .pred-student-card{padding:16px}html[data-theme] .pred-room-link{align-items:stretch;flex-direction:column}}
@media(max-width:650px){html[data-theme] .pred-seat-row{--pred-seat-basis:100%}}
@media(max-height:800px) and (orientation:landscape){
  html[data-theme] .pred-board {gap:7px;padding-block:8px}
  html[data-theme] .pred-board-material {padding:10px 14px}
  html[data-theme] .pred-reading-head h1 {font-size:26px}
  html[data-theme] .pred-board-reading h2 {font-size:22px;margin-top:5px}
  html[data-theme] .pred-seat {padding:10px}
  html[data-theme] .pred-seat-head {padding-bottom:5px;margin-bottom:6px}
  html[data-theme] .pred-options {gap:5px;margin-bottom:5px}
  html[data-theme] .pred-choice {min-height:44px;padding-block:5px}
  html[data-theme] .pred-board-footer {min-height:52px;padding-block:4px}
  html[data-theme] .pred-board-footer .btn.big {min-height:44px;padding-block:8px}
  html[data-theme] .pred-seat-submit {padding-block:8px}
}

html[data-theme] .pred-student-trail {display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:14px;row-gap:8px;margin:14px 0;padding:14px;background:var(--surface-soft);line-height:1.5}
html[data-theme] .pred-student-trail dt {color:var(--muted);font-weight:700}
html[data-theme] .pred-student-trail dd {margin:0;font-weight:700;overflow-wrap:anywhere}
html[data-theme] .pred-student-hints {padding:12px 14px;margin:14px 0;background:var(--mint);border-left:4px solid var(--green);line-height:1.6}
html[data-theme] .pred-student-hints ol {margin:0;padding-inline-start:1.25em}
html[data-theme] .pred-student-hints li+li {margin-top:6px}
html[data-theme] .pred-student-actions {display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
html[data-theme] .pred-student-actions .btn {font-size:calc(14px + var(--pred-student-font-extra))}
html[data-theme] .pred-student-actions:empty {display:none}
html[data-theme] .pred-review-date {margin:10px 0 0;color:var(--muted)}

html[data-theme="cartoon"] :is(.pred-board,dialog:has(#pred-unlock-form)) .btn.primary:not(:disabled) {background:var(--primary-dark)}
