/* Reuse the current RPG theme and controls; scope only pilot layout. */
#learningPilotView .pilot-control, #pilotWordCard { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; }
#learningPilotView .pilot-control > div, #pilotWordCard > div { flex:1 1 260px; min-width:0; }
#learningPilotView .pilot-budget { color:var(--rpg-deep); font-weight:600; font-variant-numeric:tabular-nums; }
#learningPilotView .pilot-text, #pilotParentCard .pilot-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }
#learningPilotView .pilot-label { color:var(--rpg-muted); font-size:12px; margin:14px 0 5px; }
#learningPilotView .pilot-error { color:#b63e50; }
#learningPilotView textarea, #pilotParentCard textarea, #pilotParentCard input:not([type=checkbox]), #pilotParentCard select,
#learningPilotView input, #learningPilotView select, #pilotWordMeaning input, #pilotWordMeaning select { width:100%; }
#learningPilotView form > label, #pilotParentCard .pilot-material > label { display:block; margin:12px 0; }
#learningPilotView textarea, #pilotParentCard textarea { resize:vertical; min-height:90px; }
#learningPilotView .pilot-save-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:14px; }
#learningPilotView .pilot-turn { border-left:3px solid var(--rpg-purple); }
#learningPilotView fieldset { min-width:0; margin:12px 0; }
#learningPilotView legend { color:var(--rpg-deep); font-weight:600; }
#learningPilotView #pilotSummary { margin-top:18px; padding-top:14px; border-top:1px solid var(--rpg-line); }
#learningPilotView #pilotRecordDetail { margin-top:20px; }
#pilotParentCard .pilot-settings-grid { margin:16px 0; grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr)); }
#pilotParentCard .pilot-settings-grid label { display:flex; flex-direction:column; gap:6px; }
#pilotParentCard .pilot-switches { gap:20px; }
#pilotParentCard .pilot-confirm { display:flex; align-items:flex-start; gap:8px; }
#pilotParentCard .pilot-confirm input { flex:0 0 auto; margin-top:5px; }
#pilotParentCard #pilotParentPreparations { margin:16px 0 22px; }
#pilotWordMeaning { margin:14px 0; }
#pilotWordMeaning > button { margin-top:12px; }
#learningPilotView [hidden], #pilotParentCard [hidden], #pilotWordMeaning[hidden] { display:none !important; }
@media (max-width:600px) {
  #learningPilotView .page-intro { align-items:flex-start; flex-direction:column; }
  #learningPilotView .pilot-control > button, #pilotWordCard > button { width:100%; }
  #learningPilotView .panel, #pilotParentCard { padding:16px; }
  #learningPilotView .page-intro h2 { font-size:21px; }
}
#learningPilotView .pilot-figures figure { margin:14px 0; }
#learningPilotView .pilot-figures img { display:block; max-width:100%; height:auto; border-radius:8px; }
#learningPilotView .pilot-figures figcaption { margin-top:6px; color:var(--rpg-muted); font-size:12px; }
#pilotParentCard .pilot-maintenance { margin-top:12px; }
#pilotParentCard .pilot-maintenance form { margin-top:14px; padding-top:12px; border-top:1px solid var(--rpg-line); }
#pilotParentCard .pilot-maintenance summary { cursor:pointer; overflow-wrap:anywhere; }
#pilotParentCard .pilot-parent-figures img { display:block; max-width:100%; height:auto; margin:12px 0; border-radius:8px; }

/* Keep textbook fractions and long equations inside the learning card. */
#learningPilotView mjx-container { display:inline-block; max-width:100%; overflow-x:auto; overflow-y:hidden; vertical-align:middle; }
#learningPilotView .pilot-options p { margin:8px 0; }

/* Mobile manipulatives use the existing school-learning controls and palette. */
#learningPilotView #pilotInteractive { scroll-margin-top:16px; }
#learningPilotView .mi-head h3 { margin:0 0 8px; }
#learningPilotView .mi-steps { display:flex; flex-wrap:wrap; gap:8px 14px; list-style:none; padding:0; margin:16px 0; color:var(--rpg-muted); font-size:13px; }
#learningPilotView .mi-steps [aria-current] { color:var(--rpg-deep); font-weight:700; }
#learningPilotView .mi-options, #learningPilotView .mi-actions { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
#learningPilotView .mi-options button { flex:1 1 100px; }
#learningPilotView .mi-options [aria-pressed=true] { background:var(--rpg-purple); color:white; }
#learningPilotView #pilotInteractive label { display:block; margin:14px 0; }
#learningPilotView #pilotInteractive input[type=range] { display:block; min-height:44px; padding:0; touch-action:pan-y; accent-color:var(--rpg-purple); }
#learningPilotView .mi-figure { display:block; width:100%; max-width:520px; height:auto; margin:12px auto; overflow:visible; }
#learningPilotView .mi-figure text { fill:var(--rpg-deep); font:18px system-ui,sans-serif; }
#learningPilotView .mi-shape { fill:#eee3f5; stroke:#8252a4; stroke-width:2; }
#learningPilotView .mi-line { stroke:#9f91ab; stroke-width:2; }
#learningPilotView .mi-parallel { stroke:#8252a4; stroke-width:2; stroke-dasharray:6 5; }
#learningPilotView .mi-handle { fill:#fff; stroke:#8252a4; stroke-width:3; }
#learningPilotView .mi-target { fill:#eee3f5; stroke:#8252a4; stroke-width:2; stroke-dasharray:4 3; }
#learningPilotView [data-vertex], #learningPilotView [data-piece], #learningPilotView [data-drag-shape] { touch-action:none; cursor:grab; }
#learningPilotView .mi-values { margin:14px 0; padding:12px; background:var(--rpg-paper); color:var(--rpg-deep); line-height:1.7; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
#learningPilotView .mi-dots { display:flex; flex-wrap:wrap; gap:8px; min-height:20px; margin:14px 0; }
#learningPilotView .mi-pair { display:inline-flex; gap:5px; padding:4px; background:#eee3f5; border-radius:8px; }
#learningPilotView .mi-pair i { width:10px; height:10px; border-radius:50%; background:#8252a4; }
#learningPilotView .mi-records { padding-left:20px; line-height:1.8; overflow-wrap:anywhere; }
#learningPilotView .mi-reason { padding:12px 0; line-height:1.8; }
#learningPilotView .mi-message { color:var(--rpg-deep); min-height:24px; }
#learningPilotView #pilotInteractive button { min-height:44px; max-width:100%; white-space:normal; }

#learningPilotView [data-figure], #learningPilotView [data-pieces] { touch-action:none; }
#learningPilotView .mi-touch-target { fill:transparent; stroke:none; }
