/* Scoped to the four Chapter 2 explorations; the introductory lab is unchanged. */
body[data-exploration] .workspace{grid-template-columns:minmax(0,1fr)}
body[data-exploration] #side,body[data-exploration] #action-cue,body[data-exploration] .stage-actions,body[data-exploration] .done-count{display:none}
body[data-exploration] #main{max-width:1100px}
body[data-exploration] .stage-figure{padding:18px;min-height:0}
body[data-exploration] .stage-goal{font-size:16px}
.c2-two{display:grid;grid-template-columns:1fr 1.15fr;gap:24px;align-items:start}
.c2-two>div{min-width:0}
.c2-polygon,.c2-tournament,.c2-symmetry{display:block;width:100%;max-width:390px;height:auto;margin:0 auto}
.c2-svg-math{font-size:16px;line-height:24px;text-align:center}
.c2-selected-ring{fill:none;stroke:var(--wine);stroke-width:3}
.c2-fixed-ring{fill:none;stroke:var(--ochre);stroke-width:2}
.c2-symmetry .dot-muted{fill:#858c90}
.c2-point-label{font-size:17px;fill:var(--wine);paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round}
.c2-chamber{fill:var(--wine);fill-opacity:.13;stroke:var(--wine);stroke-width:1}
.c2-card{padding:0 0 16px;margin-bottom:16px;border-bottom:1px solid var(--soft-line)}
.c2-card h3{font-size:19px;margin-bottom:8px}
.c2-card p,.c2-result p,.c2-details p{margin:8px 0;line-height:1.45}
.c2-result{padding:12px 14px;background:var(--teal-tint);border-left:3px solid var(--teal);margin:12px 0;font-size:16px}
.c2-coordinate-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:8px}
.c2-coordinate-pair>div{min-width:0;display:flex;flex-direction:column;gap:5px}
.c2-coordinate-pair span:not(.math):not(.katex):not(.katex *){font-size:14px;color:var(--muted)}
.c2-equations{display:flex;flex-direction:column;align-items:flex-start;gap:10px;margin:12px 0;font-size:16px}
.c2-details{border-top:1px solid var(--soft-line);padding:12px 0;margin-top:8px}
.c2-details summary{min-height:44px;cursor:pointer;display:list-item;align-content:center;color:var(--wine)}
.c2-details[open]{padding:12px 14px;background:var(--panel)}
.c2-coeff-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.c2-stepper{display:flex;align-items:center;gap:8px}
.c2-stepper output{min-width:20px;text-align:center;font-weight:bold}
.c2-games{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}
.c2-games .btn{min-height:44px}
.c2-symmetry-controls .seg-options{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.c2-symmetry-controls .seg:last-child .seg-options{display:flex;flex-wrap:wrap}
.c2-symmetry-controls .seg{display:block;margin-top:12px}
.c2-symmetry-controls .seg-label{display:block;margin-bottom:8px}
.c2-symmetry-controls .btn{font-size:15px;padding:8px;min-height:44px}
.c2-legend{font-size:14px;color:var(--muted);line-height:1.4}
body[data-exploration] .btn:focus-visible,body[data-exploration] summary:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
@media(max-width:640px){
 body[data-exploration] .stage-actions{display:flex;justify-content:flex-end}
 body[data-exploration] .stage-actions #show-me,body[data-exploration] .stage-actions #actions-note{display:none}
 body[data-exploration] .mobile-tools{display:flex}
 body[data-exploration] .stage-figure{padding:12px}
 .c2-two{grid-template-columns:minmax(0,1fr);gap:16px}
 .c2-polygon{max-width:300px}
 .c2-tournament{max-width:300px}
 .c2-symmetry{max-width:300px}
 .c2-coordinate-pair{gap:10px}
 .c2-coordinate-pair .math{font-size:17px}
 .c2-equations{font-size:13px;gap:12px}
 .c2-details .c2-equations{font-size:14px}
 .c2-card .ehr-table{font-size:15px}
 body[data-exploration] .scene-nav .btn{font-size:15px}
}

/* Tournament lesson: names, arrows and the wins they contribute. */
.c2-score-exploration{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}
.c2-score-exploration .c2-score-workbench{min-width:0}
.c2-score-exploration .c2-arrow-rule{font-size:16px;line-height:1.4;margin:0 0 10px}
.c2-score-exploration .c2-graph-counts{display:grid;grid-template-columns:minmax(0,1fr) 142px;gap:12px;align-items:center}
.c2-score-exploration .c2-tournament{max-width:270px}
.c2-score-exploration .c2-letter-label{font-size:28px}
.c2-score-exploration .c2-win-counts{display:flex;flex-direction:column;gap:6px}
.c2-score-exploration .c2-win-row{border-left:4px solid var(--player-color);padding:6px 8px;background:var(--panel)}
.c2-score-exploration .c2-win-row>div{display:flex;gap:8px;justify-content:space-between;align-items:baseline}
.c2-score-exploration .c2-win-row b{color:var(--player-color);font-size:19px}
.c2-score-exploration .c2-win-row strong{font-size:16px;white-space:nowrap}
.c2-score-exploration .c2-win-row small{display:block;font-size:13px;line-height:1.35;margin-top:2px}
.c2-score-exploration .c2-game-control{margin:10px 0 12px}
.c2-score-exploration .c2-game-control>p{font-size:15px;margin:0 0 6px}
.c2-score-exploration .c2-games{margin-top:0}
.c2-score-exploration .c2-games .btn{border-color:var(--player-color);color:var(--player-color);font-size:15px;padding:8px 5px;display:flex;justify-content:center;align-items:center;gap:8px;min-height:44px}
.c2-score-exploration .c2-credit{font-size:13px;font-weight:bold;padding-left:6px;border-left:1px solid currentColor}
.c2-score-exploration .c2-game-label,.c2-score-exploration .c2-credit{white-space:nowrap}
.c2-score-exploration .c2-sorted-counts{padding:10px 12px;background:var(--teal-tint);border-left:3px solid var(--teal)}
.c2-score-exploration .c2-sorted-counts h3{font-size:18px;margin:0 0 4px}
.c2-score-exploration .c2-sorted-counts p{font-size:15px;line-height:1.35;margin:0 0 8px}
.c2-score-exploration .c2-sorted-list{display:flex;gap:8px;list-style:none;padding:0;margin:0}
.c2-score-exploration .c2-sorted-list li{padding:4px 12px;background:#fff;border:1px solid var(--line);font-size:19px;line-height:1.3}
.c2-score-exploration .c2-score-status{font-size:15px;line-height:1.4;margin:10px 0 0}
.c2-score-exploration .c2-win-A{--player-color:var(--wine)}
.c2-score-exploration .c2-win-B{--player-color:var(--teal)}
.c2-score-exploration .c2-win-C{--player-color:var(--ochre)}
.c2-score-exploration .c2-win-D{--player-color:var(--slate)}
.c2-score-exploration .c2-edge-A,.c2-score-exploration .c2-player-A{stroke:var(--wine)}
.c2-score-exploration .c2-edge-B,.c2-score-exploration .c2-player-B{stroke:var(--teal)}
.c2-score-exploration .c2-edge-C,.c2-score-exploration .c2-player-C{stroke:var(--ochre)}
.c2-score-exploration .c2-edge-D,.c2-score-exploration .c2-player-D{stroke:var(--slate)}
.c2-score-exploration .c2-marker-A{fill:var(--wine)}
.c2-score-exploration .c2-marker-B{fill:var(--teal)}
.c2-score-exploration .c2-marker-C{fill:var(--ochre)}
.c2-score-exploration .c2-marker-D{fill:var(--slate)}
@media(max-width:640px){
 .c2-score-exploration{grid-template-columns:minmax(0,1fr)}
 .c2-score-exploration .c2-graph-counts{grid-template-columns:minmax(0,1fr) 126px;gap:10px}
 .c2-score-exploration .c2-arrow-rule{font-size:15px}
 .c2-score-exploration .c2-games .btn{font-size:14px;flex-direction:column;gap:2px;padding:5px 4px}
 .c2-score-exploration .c2-credit{font-size:12px;padding-left:0;border-left:0;line-height:1.1}
}

/* One compact counting workbench, followed by its patterns and their record. */
.ec-lab{max-width:900px;margin:0 auto}
.ec-lab section+section{border-top:1px solid var(--soft-line);margin-top:24px;padding-top:22px}
.ec-lab h3{font-size:21px;margin:0 0 10px}
.ec-lab p{line-height:1.45;margin:10px 0}
.ec-lab .ec-workbench{min-height:385px}
.ec-lab .ec-workbench>.seg{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.ec-lab .ec-picture-controls{display:grid;grid-template-columns:minmax(0,310px) minmax(0,1fr);gap:24px;align-items:center}
.ec-lab .ec-picture{display:block;width:100%;max-width:305px;margin:auto}
.ec-lab .ec-choices .seg{display:block}
.ec-lab .ec-choices .seg-label{display:block;margin-bottom:8px}
.ec-lab .ec-choices .seg-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.ec-lab .ec-choices .btn{min-height:44px;padding:8px;font-size:16px}
.ec-lab #triangle-result{min-height:110px;margin:12px 0 0}
.ec-lab .ec-total{font-size:16px;min-height:46px;margin:0}
.ec-lab .ec-triangle{fill:var(--ec-color);fill-opacity:.13;stroke:#555;stroke-width:1.4}
.ec-lab .ec-faded{fill-opacity:.025;stroke:#aaa}
.ec-lab .ec-dot{fill:var(--ec-color);stroke:#fff;stroke-width:1.4}
.ec-lab .ec-old{fill:#fff;stroke:#555;stroke-width:2}
.ec-lab .ec-outside{fill:#aaa;stroke:#fff;opacity:.4}
.ec-lab .ec-0{--ec-color:var(--wine)}
.ec-lab .ec-1{--ec-color:var(--teal)}
.ec-lab .ec-2{--ec-color:var(--ochre)}
.ec-lab .ec-3{--ec-color:var(--slate)}
.ec-lab .ec-letter{font-size:17px;fill:#222;paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round}
.ec-lab .ehr-table{width:100%;table-layout:fixed;font-size:16px}
.ec-lab .ehr-table th:first-child{width:34%;text-align:left}
.ec-lab .ec-current{background:var(--teal-tint);font-weight:bold}
.ec-lab .ec-sum{border-top:2px solid var(--line);font-weight:bold}
.ec-lab .ec-pattern-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px}
.ec-lab .ec-pattern-cards>div{background:var(--panel);padding:12px}
.ec-lab .ec-pattern-cards h4{font-size:17px;line-height:1.3;min-height:44px;margin:0}
.ec-lab .ec-pattern-cards p{margin:5px 0;font-size:15px}
.ec-lab .ec-pattern-cards small{font-size:15px}
.ec-lab .ec-dot-rows{height:88px;display:flex;flex-direction:column;justify-content:center;gap:5px}
.ec-lab .ec-dot-rows span{display:flex;gap:7px;font-size:14px}
.ec-lab .ec-dot-rows i{display:block;width:12px;height:12px;border-radius:50%;background:var(--teal)}
.ec-lab .ec-polynomial{font-size:19px;padding:12px 0;overflow-x:auto}
.ec-lab .ec-record{max-width:750px}
.ec-lab .c2-equations{max-width:100%;overflow-x:auto;padding:4px 0 8px}
@media(max-width:640px){
 .ec-lab .ec-workbench{min-height:650px}
 .ec-lab .ec-picture-controls{grid-template-columns:minmax(0,1fr);gap:0}
 .ec-lab .ec-picture{max-width:255px}
 .ec-lab .ec-choices .seg-options{grid-template-columns:repeat(3,minmax(0,1fr))}
 .ec-lab .ec-choices .btn{font-size:14px;padding:7px 4px}
 .ec-lab #triangle-result{min-height:122px;font-size:15px;margin-top:10px}
 .ec-lab .ec-total{font-size:15px;min-height:85px;margin-top:8px}
 .ec-lab .ec-pattern-cards{grid-template-columns:minmax(0,1fr);gap:10px}
 .ec-lab .ec-pattern-cards>div{display:grid;grid-template-columns:1.2fr 1fr;column-gap:10px}
 .ec-lab .ec-pattern-cards h4{min-height:0;grid-column:1}
 .ec-lab .ec-pattern-cards p{grid-column:1}
 .ec-lab .ec-dot-rows{grid-column:2;grid-row:1/4;height:80px}
 .ec-lab .ec-polynomial{font-size:20px}
 .ec-lab .ehr-table{font-size:14px}
 .ec-lab .ehr-table th,.ec-lab .ehr-table td{padding:8px 4px}
}

/* Explicit dictionaries: wins -> coordinates -> chamber; slots -> image. */
.cx-score-lab,.cx-symmetry-lab{max-width:900px;margin:auto}
.cx-score-lab>section+section,.cx-symmetry-lab>section+section{border-top:1px solid var(--soft-line);margin-top:24px;padding-top:22px}
.cx-score-lab h3,.cx-symmetry-lab h3{font-size:21px;margin:0 0 10px}
.cx-score-lab p,.cx-symmetry-lab p{line-height:1.45}
.cx-score-lab .c2-graph-counts{grid-template-columns:minmax(0,330px) minmax(0,1fr);max-width:680px;margin:auto}
.cx-score-lab .c2-tournament{max-width:300px}
.cx-score-lab .c2-games{max-width:680px;margin-left:auto;margin-right:auto}
.cx-score-lab .c2-score-status{min-height:44px}
.cx-score-presets{margin-bottom:16px}
.cx-score-presets .seg{display:block}
.cx-score-presets .seg-label{display:block;margin-bottom:8px}
.cx-correspondence{scroll-margin-top:16px}
.cx-conversion-point{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:22px;align-items:center}
.cx-conversion-point .cx-point-evidence{grid-template-columns:205px minmax(0,1fr);gap:12px}
.cx-conversion-point .cx-point-evidence h3{font-size:18px}
.cx-conversion-point .cx-point-evidence p{font-size:15px}
.cx-conversion .ehr-table{table-layout:fixed;width:100%;font-size:16px}
.cx-conversion .ehr-table th,.cx-conversion .ehr-table td{padding:6px 10px;text-align:center}
.cx-conversion .ehr-table caption{text-align:left;line-height:1.4;font-size:15px;margin-bottom:8px}
.cx-conversion-equation{font-size:17px}
.cx-point-evidence{display:grid;grid-template-columns:245px minmax(0,1fr);align-items:center;gap:18px;margin:12px 0}
.cx-chamber-picture{width:100%;max-width:245px;display:block}
.cx-chamber-picture .c2-point-label{font-size:25px}
.cx-score-point,.cx-input-dot{fill:var(--wine);stroke:#fff;stroke-width:1.5}
.cx-other-point{fill:#858c90;stroke:#fff;stroke-width:1}
.cx-point-evidence .c2-legend{max-width:360px}
.cx-prefixes{padding:12px 14px;background:var(--panel);border-left:3px solid var(--wine)}
.cx-prefixes>p{font-size:15px;margin:8px 0}
.cx-prefix{display:grid;grid-template-columns:1fr auto;gap:3px 12px;padding:8px 0;border-top:1px solid var(--soft-line)}
.cx-prefix>span{font-size:15px}
.cx-prefix>strong{font-size:18px}
.cx-prefix>small{grid-column:1/-1;font-size:14px;line-height:1.35}
.cx-prefix-conclusion{font-weight:bold}
.cx-symmetry-lab>.seg{display:block;margin:16px 0}
.cx-symmetry-lab>.seg>.seg-label{display:block;margin-bottom:8px}
.cx-symmetry-lab>.seg:nth-of-type(2)>.seg-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.cx-symmetry-lab>.seg:nth-of-type(2) .btn{font-size:15px;min-height:48px;padding:7px}
.cx-tuple-choices{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 16px}
.cx-tuple-choices .btn{min-height:44px;font-size:16px;padding:7px 12px}
.cx-choice-label{min-height:24px;margin:10px 0 5px}
.cx-symmetry-workbench{padding:14px;border:1px solid var(--soft-line);background:var(--panel);scroll-margin-top:16px}
.cx-operation{text-align:center;font-size:19px;margin-bottom:10px}
.cx-symmetry-core{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:20px;align-items:center}
.cx-slots{display:grid;grid-template-columns:30px repeat(3,minmax(0,1fr));gap:7px;align-items:center;text-align:center}
.cx-slots>b{font-size:19px}
.cx-slot-heading{font-size:18px}
.cx-slot-heading small{display:block;font-size:12px;line-height:1.2;margin-top:4px}
.cx-slot{background:#fff;border:1px solid var(--line);border-top:4px solid var(--slot-color);font-size:23px;padding:8px}
.cx-slot-0{--slot-color:var(--wine)}
.cx-slot-1{--slot-color:var(--teal)}
.cx-slot-2{--slot-color:var(--ochre)}
.cx-slots .cx-slot{color:#182a3c}
.cx-symmetry-picture{max-width:370px}
.cx-background-dot{fill:#a5aaad}
.cx-orbit-dot{fill:var(--teal);stroke:#fff;stroke-width:1}
.cx-reflection-line{stroke:var(--ochre);stroke-width:2;stroke-dasharray:6 4}
.cx-image-path{stroke:var(--wine);stroke-width:2;fill:none}
.cx-image-marker{fill:var(--wine)}
.cx-image-ring{fill:none;stroke:var(--wine);stroke-width:2.5}
.cx-input-label,.cx-image-label{font-size:16px;fill:var(--wine);paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round}
.cx-centre-label{font-size:16px;fill:var(--wine);paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round}
.cx-symmetry-result{font-size:16px;line-height:1.4;min-height:46px;margin-top:8px}
.cx-symmetry-result p{margin:4px 0}
.cx-symmetry-result .cx-movement{min-height:44px}
.cx-symmetry-result .cx-geometry-note{font-size:14px;min-height:40px}
.cx-plot-legend{font-size:14px;line-height:1.35!important;margin:8px 0 12px}
.cx-orbit-group{display:grid;grid-template-columns:30px 145px minmax(0,1fr) 24px;gap:12px;align-items:center;border-bottom:1px solid var(--soft-line);padding:9px 8px}
.cx-orbit-group.cur{background:var(--teal-tint)}
.cx-counted-dots{display:flex;gap:7px;flex-wrap:wrap}
.cx-counted-dots i{width:10px;height:10px;display:block;border-radius:50%;background:var(--teal)}
.cx-burnside-average .ehr-table{width:100%;font-size:16px}
.cx-burnside-average .c2-equations{font-size:18px}
@media(max-width:640px){
 .cx-score-lab .c2-graph-counts{grid-template-columns:minmax(0,1fr) 126px}
 .cx-score-lab h3,.cx-symmetry-lab h3{font-size:19px}
 .cx-score-presets .seg-options{display:grid;grid-template-columns:1fr 1fr}
 .cx-score-presets .btn{font-size:14px;padding:7px 5px;min-height:50px}
 .cx-conversion .ehr-table{font-size:15px}
 .cx-conversion-point{grid-template-columns:minmax(0,1fr);gap:2px}
 .cx-conversion-point .cx-point-evidence{display:block}
 .cx-conversion-point .cx-point-evidence::after{content:"";display:block;clear:both}
 .cx-conversion-point .cx-chamber-picture{float:left;width:128px;margin:2px 10px 0 0}
 .cx-conversion-point .cx-point-evidence h3{margin-top:0}
 .cx-conversion-point .cx-point-evidence h3{font-size:16px}
 .cx-conversion-point .cx-point-evidence p{font-size:14px}
 .cx-conversion-point .cx-point-evidence .c2-legend{font-size:12px}
 .cx-conversion .ehr-table caption{font-size:14px}
 .cx-conversion .ehr-table th,.cx-conversion .ehr-table td{padding:2px 5px}
 .cx-conversion-equation{font-size:14px}
 .cx-point-evidence{grid-template-columns:148px minmax(0,1fr);gap:8px;margin:10px 0}
 .cx-point-evidence h3{font-size:16px;margin-bottom:6px}
 .cx-point-evidence p{font-size:14px;line-height:1.35;margin:5px 0}
 .cx-point-evidence .c2-legend{font-size:12px}
 .cx-prefixes{padding:8px 10px}
 .cx-correspondence h3{margin-bottom:6px}
 .cx-prefixes>p{font-size:14px;line-height:1.35;margin:6px 0}
 .cx-prefix{padding:5px 0;gap:2px 8px}
 .cx-prefix>span{font-size:14px}
 .cx-prefix>strong{font-size:16px}
 .cx-prefix>small{font-size:13px}
 .cx-symmetry-lab>.seg:nth-of-type(2)>.seg-options{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cx-symmetry-lab>.seg:nth-of-type(2) .btn{font-size:14px}
 .cx-tuple-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
 .cx-tuple-choices .btn{font-size:13px;padding:7px 3px}
 .cx-symmetry-workbench{padding:10px}
 .cx-symmetry-core{grid-template-columns:minmax(0,1fr);gap:6px}
 .cx-slots{max-width:310px;margin:auto;width:100%;gap:5px}
 .cx-slot{font-size:20px;padding:5px}
 .cx-slot-heading{font-size:16px}
 .cx-slot-heading small{font-size:11px;margin-top:2px}
 .cx-symmetry-picture{max-width:270px}
 .cx-symmetry-picture .cx-input-label,.cx-symmetry-picture .cx-image-label,.cx-symmetry-picture .cx-centre-label{font-size:19px}
 .cx-operation{font-size:16px;margin-bottom:8px}
 .cx-symmetry-result{font-size:15px;min-height:62px;margin-top:2px}
 .cx-symmetry-result .cx-movement{min-height:62px}
 .cx-symmetry-result .cx-geometry-note{min-height:56px}
 .cx-plot-legend{font-size:13px}
 .cx-orbit-group{grid-template-columns:18px 100px minmax(0,1fr) 16px;gap:8px;padding:8px 4px;font-size:15px}
 .cx-counted-dots{gap:5px}
 .cx-counted-dots i{width:9px;height:9px}
 .cx-burnside-average .ehr-table{font-size:14px}
 .cx-burnside-average .c2-equations{font-size:16px}
}

/* v13: in the symmetry experiment the object and its controls sit side by side inside one workbench
   (desktop), and the object comes first on narrow screens; the actor and the consequence stay together. */
.cx-sym-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:20px;align-items:start}
.cx-sym-object,.cx-sym-side{min-width:0}
.cx-sym-object .cx-symmetry-core{grid-template-columns:minmax(0,1fr);gap:8px}
.cx-sym-side>.seg{display:block;margin:0 0 12px}
.cx-sym-side>.seg>.seg-label{display:block;margin-bottom:6px}
.cx-sym-side>.seg .seg-options{display:flex;flex-wrap:wrap;gap:6px}
.cx-sym-side>.seg:nth-of-type(2)>.seg-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.cx-sym-side>.seg .btn{font-size:15px;min-height:44px;padding:6px 8px}
@media(max-width:760px){.cx-sym-layout{grid-template-columns:minmax(0,1fr);gap:12px}}
#symmetry-object:focus{outline:3px solid var(--focus);outline-offset:2px}
.c2-rule-line{font-size:15px;color:var(--muted);margin:8px 0 0}
