@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');
:root{font-family:'DM Sans',sans-serif;color:#233e35;background:#f3f5f1;--green:#354e46;--muted:#697a70;--line:#dce5dc;--error:#ac3429;--number:#2455aa;--number-soft:#edf3ff;--shell:#925400;--shell-soft:#fff2ce;--valence:#7743ad;--valence-soft:#f3eafb}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;padding:28px 20px}button,select{font:inherit}button,select,.electron-source{-webkit-tap-highlight-color:transparent}button:focus-visible,select:focus-visible,.electron-source:focus-visible{outline:3px solid #b77724;outline-offset:4px}
.lab{max-width:980px;margin:0 auto;background:white;border:1px solid var(--line);border-radius:18px;padding:26px 30px 20px}.heading{display:flex;align-items:center;justify-content:space-between;gap:16px}h1{font-size:25px;letter-spacing:-.7px;font-weight:600;line-height:1.25;margin:0}select{max-width:190px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--muted);font-size:13px;padding:9px 12px}
.popup{display:flex;align-items:center;gap:11px;min-height:53px;margin-top:20px;padding:12px 15px;border:1px solid #dde4df;border-radius:9px;background:#fafbf9;color:#34483f}.popup p{font-size:14px;line-height:1.5;margin:0}.popup-symbol{display:grid;place-items:center;flex:0 0 22px;height:22px;border-radius:50%;background:#e8ece7;font-size:13px;font-weight:700}.popup.error{border-color:#e4ac9b;background:#fff0ea;color:#943727}.popup.error .popup-symbol{background:#f8d9cf}.popup.success{background:#f5f8f2;border-color:#bacbb8;color:#34483f}.popup.valence{background:#faf7fe;border-color:#d4c2e7}.popup.valence .popup-symbol{background:var(--valence-soft);color:var(--valence)}.popup.pulse{animation:appear .18s ease-out}
.scene{display:grid;grid-template-columns:156px minmax(0,1fr);grid-template-rows:1fr auto;column-gap:38px;min-height:390px;padding:22px 0 12px;align-items:center}.element-card{grid-column:1;grid-row:1;width:156px;padding:12px 14px 11px;border:1.5px solid #c9d3cb;border-radius:9px;background:#fdfefb;align-self:center}.element-card.spotlight{border-color:#c9d3cb}.number-row{display:flex;align-items:center;gap:8px}.atomic-number{display:grid;place-items:center;min-width:33px;height:34px;border:2px solid transparent;border-radius:5px;font-size:23px;font-weight:600}.atomic-number{color:var(--number);border-color:#b8ccec;background:var(--number-soft)}.spotlight .atomic-number{border-color:var(--number);box-shadow:0 0 0 3px var(--number-soft)}.atomic-label{font-size:10px;line-height:1.35;color:var(--number);max-width:60px}.element-symbol{font-size:63px;font-weight:500;letter-spacing:-2px;text-align:center;line-height:1.15;margin-top:9px}.element-name{font-size:14px;text-align:center;margin:5px 0 13px}.atomic-mass{text-align:center;border-top:1px solid var(--line);padding-top:9px;color:var(--muted);font-size:11px}.atom-stage{grid-column:2;grid-row:1/3;min-width:0;text-align:center}.atom-stage svg{display:block;width:100%;height:370px;overflow:visible;touch-action:none;user-select:none}.model-caption{display:block;font-size:11px;color:#7c8a7e;margin-top:3px}
.shell-halo{fill:none;stroke:var(--shell-soft);stroke-width:28;opacity:0}.shell-group.active .shell-halo,.shell-group.valence .shell-halo{opacity:1}.shell-ring{fill:none;stroke:#bdcdbf;stroke-width:1.5}.shell-group.future .shell-ring{stroke-dasharray:4 7}.shell-group.active .shell-ring{stroke:var(--shell);stroke-width:2}.shell-group.valence .shell-ring{stroke:var(--valence);stroke-width:2.5}.shell-group.valence .shell-halo{stroke:var(--valence-soft)}.shell-group.checked:not(.active):not(.valence) .shell-ring{stroke:#c5ccc7}.shell-hit{fill:none;stroke:transparent;stroke-width:32;cursor:crosshair;pointer-events:stroke}.shell-group:focus-visible{outline:none}.shell-focus{fill:none;stroke:#35443d;stroke-width:1.5;stroke-dasharray:2 5;opacity:0;pointer-events:none}.shell-group:focus-visible .shell-focus{opacity:1}.shell-group.drop-hover .shell-halo{stroke:#f5d890}.shell-label{font-family:inherit;font-size:12px;fill:#78897c;pointer-events:none}.shell-group.active .shell-label{fill:var(--shell);font-weight:700}.shell-group.valence .shell-label{fill:var(--valence);font-weight:700}.nucleus-disc{fill:#f1f4ef;stroke:#ced7ce;stroke-width:1}.nucleus-symbol{font-family:inherit;font-size:27px;font-weight:600;fill:#52684b;text-anchor:middle}.nucleus-label{font-size:10px;fill:var(--number);text-anchor:middle}.electron{cursor:grab;touch-action:none}.electron:active{cursor:grabbing}.electron-dot{fill:var(--shell);stroke:#fff;stroke-width:2}.electron-minus{stroke:#fff;stroke-width:1.7;pointer-events:none}.electron.inner .electron-dot{fill:#839087}.electron.valence .electron-dot{fill:var(--valence)}.electron.excess .electron-dot{fill:var(--error)}.electron-target{fill:transparent}
.supply-area{grid-column:1;grid-row:2;display:flex;align-items:center;gap:9px;padding:15px 0 8px;align-self:start}.supply-area strong{font-size:12px;font-weight:500}.supply-area p{font-size:10px;line-height:1.5;color:var(--muted);margin:4px 0 0}.electron-source{width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;border:1px dashed #b49360;border-radius:50%;cursor:grab;touch-action:none;user-select:none}.electron-source span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--shell);color:#fff;font-size:23px}.electron-source.selected{background:var(--shell-soft);border:2px solid var(--shell)}.electron-source[aria-disabled=true]{opacity:.4;cursor:default}.supply-area.return-hover{background:var(--shell-soft);border-radius:6px;outline:6px solid var(--shell-soft)}
.controls{display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid #edf0e9;padding-top:17px;margin-top:6px}.placed-count{font-size:13px;color:var(--muted);margin:0}.placed-count strong{color:#253e32;font-weight:600}.actions{display:flex;gap:9px}.button{min-height:43px;padding:10px 17px;border:1px solid var(--line);border-radius:7px;cursor:pointer;font-size:13px;font-weight:500}.button.secondary{background:#fff;color:var(--muted)}.button.secondary:hover{background:#f4f7f1}.button.primary{display:flex;align-items:center;justify-content:center;gap:16px;min-width:131px;background:var(--green);border-color:var(--green);color:#fff}.button.primary:hover{background:#243c34}.button:disabled{cursor:default;opacity:.45}.completion .model-caption,.completion h1{color:var(--valence)}.completion .electron{cursor:default}.drag-electron{position:fixed;z-index:10;pointer-events:none;display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:var(--shell);color:#fff;border:2px solid #fff;font-size:24px;box-shadow:0 4px 12px #173d3b33;transform:translate(-50%,-50%)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes appear{from{opacity:.7;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:651px) and (max-height:740px){body{padding-top:18px;padding-bottom:18px}.lab{padding-top:20px}.scene{min-height:300px}.atom-stage svg{height:clamp(235px,calc(100vh - 275px),340px)}}
@media(max-width:650px){body{padding:14px 12px}.lab{padding:20px 18px 17px;border-radius:13px}.heading{gap:12px}h1{font-size:22px}select{font-size:14px;padding:8px;max-width:153px}.popup{margin-top:17px;padding:11px 12px}.popup p{font-size:13px}.scene{grid-template-columns:105px minmax(0,1fr);column-gap:12px;min-height:0;padding-top:22px}.element-card{width:105px;padding:8px 10px;align-self:center}.atomic-number{font-size:19px;min-width:28px;height:29px}.atomic-label{font-size:8px}.number-row{gap:4px}.element-symbol{font-size:43px;margin-top:4px}.element-name{font-size:11px;margin:4px 0 9px}.atomic-mass{font-size:10px;padding-top:7px}.atom-stage svg{height:280px}.atom-stage{grid-column:1/3;grid-row:2;margin-top:10px}.element-card{grid-column:1;grid-row:1}.supply-area{grid-column:2;grid-row:1;align-self:center;justify-self:center;max-width:162px;padding:0 0 0 4px}.supply-area strong{font-size:12px}.supply-area p{font-size:10px}.controls{padding-top:15px;gap:10px}.placed-count{font-size:12px}.button{padding:10px 12px;min-height:44px;font-size:12px}.button.primary{min-width:116px;gap:9px}.actions{gap:6px}.model-caption{font-size:10px}}
@media(max-width:370px){body{padding:8px}.lab{padding:17px 13px 15px}.heading h1{font-size:21px}select{max-width:130px;font-size:12px}.supply-area{gap:7px;padding-left:0}.supply-area strong{font-size:11px}.supply-area p{font-size:9px}.electron-source{width:40px;height:40px;flex-basis:40px}.button{padding:10px}.button.primary{min-width:110px}.placed-count{font-size:11px}.atom-stage svg{height:250px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* The same concept keeps its color in instructions, the element tile, and the model. */
.concept{font-weight:600;padding:1px 3px;border-radius:3px;border-bottom:2px solid;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.concept-number{color:var(--number);background:var(--number-soft);border-color:#a7c0e8}
.concept-shell{color:var(--shell);background:var(--shell-soft);border-color:#d8ae61}
.concept-valence{color:var(--valence);background:var(--valence-soft);border-color:#c3a4df}
.valence-result{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #d8c6e9;margin-top:12px;padding-top:10px;color:var(--valence)}
.valence-result>span{font-size:10px;line-height:1.4}.valence-result small{display:block;font-size:8px;color:#73677e;margin-top:2px}.valence-result strong{font-size:22px;font-weight:600;background:var(--valence-soft);border:1px solid #c3a4df;border-radius:5px;min-width:30px;text-align:center;padding:2px 4px}
@media(max-width:650px){.valence-result{gap:4px}.valence-result>span{font-size:9px}.valence-result strong{font-size:18px;min-width:24px}.valence-result small{font-size:8px}}

.lesson-progress{font-size:11px;color:var(--muted);margin:0 0 6px;letter-spacing:.3px}.heading>div{min-width:0}
.answer-area{grid-column:1;grid-row:2;display:flex;flex-direction:column;gap:8px;font-size:12px;line-height:1.5;color:var(--number);align-self:start;padding-top:12px}
.answer-area input{font:inherit;font-size:24px;text-align:center;width:85px;min-height:48px;padding:6px;border:2px solid #a7c0e8;border-radius:7px;color:var(--number);background:var(--number-soft)}
.answer-area input:focus-visible{outline:3px solid var(--number);outline-offset:3px}.answer-area input[aria-invalid=true]{border-color:var(--error);background:#fff0ea}
#count-display[hidden]+.actions{margin-left:auto}.nucleus-label.neutral{fill:var(--muted)}
.shell-group.drop-hover .shell-halo{opacity:1}.shell-group.drop-hover .shell-ring{stroke:var(--shell);stroke-width:2}.shell-group.invalid .shell-ring{stroke:var(--error);stroke-width:2.5}.shell-group.invalid .shell-halo{opacity:1;stroke:#fce7e1}
.selection-task .electron{cursor:pointer}.selection-task .shell-hit{cursor:default}.electron.selected .electron-dot{fill:var(--shell);stroke:#f4d28c;stroke-width:3}.electron:focus-visible{outline:none}.electron:focus-visible .electron-target{stroke:var(--shell);stroke-width:2}
.total-task.completion h1,.total-task.completion .model-caption{color:var(--number)}
@media(max-width:650px){.lesson-progress{font-size:10px;letter-spacing:0}.heading{align-items:flex-start}.heading select{max-width:145px}.answer-area{grid-column:2;grid-row:1;justify-self:center;align-self:center;padding:0;max-width:155px}.answer-area input{font-size:22px;width:80px}}
@media(max-width:370px){.heading select{max-width:121px;font-size:11px}.lesson-progress{font-size:9px}.answer-area{font-size:11px}}

/* Ions: shared blue positive-proton and purple negative-electron concepts. */
.ion-scene{display:flex;align-items:center;justify-content:center;gap:12px;padding:20px 0 8px}.ion-atom{flex:1;min-width:0;text-align:center;border:2px solid transparent;border-radius:12px;padding:8px}.ion-atom:focus-visible,.ion-holder:focus-visible{outline:3px solid var(--shell);outline-offset:2px;background:#fffcf3}.ion-tile{display:grid;grid-template-columns:34px auto;gap:4px 8px;border:1px solid var(--line);border-radius:7px;width:150px;margin:auto;padding:8px;text-align:left;align-items:center}.ion-tile>strong{grid-column:1;font-size:28px;text-align:center}.ion-tile>span:last-child{font-size:12px}.ion-tile .atomic-label{max-width:none}.ion-atom svg{display:block;width:100%;height:270px;touch-action:none;user-select:none}.ion-ring{fill:none;stroke:#cad3cc;stroke-width:1.5}.ion-ring.highlight{stroke:var(--valence);stroke-width:2}.ion-ring.empty{stroke-dasharray:4 5;opacity:.65}.ion-protons{font-size:9px;fill:var(--number);text-anchor:middle}.ion-dot{fill:#839087;stroke:white;stroke-width:2}.ion-electron.outer .ion-dot{fill:var(--valence)}.ion-electron text{fill:white;font-size:16px;pointer-events:none}.ion-hit{fill:transparent}.ion-electron{cursor:grab;touch-action:none}.ion-electron:focus-visible{outline:none}.ion-electron:focus-visible .ion-hit,.ion-electron.picked .ion-hit{stroke:var(--shell);stroke-width:2}.ion-ledger{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;font-size:12px}.ion-charge{font-size:16px;font-weight:600;min-height:28px;margin:12px 0 0}.ion-charge.positive{color:var(--number)}.ion-charge.negative{color:var(--valence)}.ion-holder{width:210px;min-height:170px;flex:0 1 210px;background:#faf7fe;border:2px dashed #c3a4df;border-radius:12px;padding:18px;text-align:center}.ion-holder strong{font-size:15px}.ion-holder p,.ion-holder small{font-size:12px;color:var(--muted)}.holder-electrons{min-height:44px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center}.holder-electron{display:grid;place-items:center;background:var(--valence);color:white;width:30px;height:30px;border-radius:50%;font-size:22px;cursor:grab;touch-action:none}.holder-electron:focus-visible,.holder-electron.picked{outline:3px solid var(--shell);outline-offset:3px}.transfer-arrow{color:var(--valence);font-size:28px}.ion-note,.ion-help{font-size:12px;color:var(--muted);line-height:1.5;margin:0}.ion-help{margin-top:12px;font-size:11px}.ion-answer{display:flex;align-items:center;justify-content:center;gap:12px;color:var(--valence);font-size:14px;margin:10px 0 20px}.ion-answer input{font:inherit;font-size:20px;width:160px;padding:10px;border:2px solid #c3a4df;border-radius:7px}.ion-answer input[aria-invalid=true]{border-color:var(--error)}.ion-scene.single .ion-atom{max-width:410px}.ion-lab .drag-electron{background:var(--valence)}
@media(max-width:650px){.ion-scene{gap:3px;align-items:flex-start}.ion-atom{padding:3px 0}.ion-atom svg{height:auto}.ion-tile{width:120px;gap:3px;padding:6px;grid-template-columns:29px auto}.ion-tile>span:last-child{font-size:10px}.ion-tile .atomic-label{font-size:9px}.ion-ledger{font-size:10px;gap:5px}.ion-charge{font-size:12px}.transfer-arrow{font-size:18px;align-self:center}.ion-holder{padding:12px 8px;align-self:center;flex-basis:130px;min-height:140px}.ion-holder strong{font-size:12px}.ion-holder p{font-size:10px}.ion-note{font-size:10px;max-width:110px}.ion-lab .controls{gap:8px}.ion-lab .button.primary{min-width:100px}.ion-lab .heading select{max-width:145px}.ion-scene.single .ion-atom{max-width:300px}}
@media(max-width:370px){.ion-tile{width:107px}.ion-lab .heading select{max-width:120px}.ion-lab h1{font-size:19px}.ion-charge{font-size:11px}.ion-note{max-width:85px}.ion-lab .button{padding:9px}.ion-lab .button.primary{min-width:94px}}

.energy-guide{flex:0 1 290px;min-width:0;text-align:left}.energy-guide h2{font-size:15px;line-height:1.4;margin:0 0 12px}.energy-option{border-left:4px solid #c98c36;background:#fff8e9;padding:10px 12px;margin:8px 0;border-radius:0 7px 7px 0}.energy-option strong{font-size:13px;color:var(--shell)}.energy-option p{font-size:12px;line-height:1.5;margin:4px 0 0}.energy-option.energy-stay{border-color:var(--valence);background:var(--valence-soft)}.energy-stay strong{color:var(--valence)}.energy-guide>small{font-size:10px;color:var(--muted)}.prediction-answer{display:flex;justify-content:center;align-items:center;gap:12px;font-size:14px;margin:12px 0 22px}.prediction-answer select{max-width:210px;min-width:180px;font-size:15px;color:var(--green);border:2px solid #c3a4df;padding:11px;background:#faf7fe}.prediction-answer select[aria-invalid=true]{border-color:var(--error)}.reading-model .ion-electron{cursor:default}.ion-scene:has(.energy-guide){align-items:center}
@media(max-width:650px){.ion-scene:has(.energy-guide){flex-wrap:wrap}.ion-scene:has(.energy-guide) .ion-atom{flex:1 1 100%;max-width:240px}.energy-guide{flex:1 1 100%;display:grid;grid-template-columns:1fr 1fr;gap:7px}.energy-guide h2,.energy-guide>small,.energy-stay{grid-column:1/-1}.energy-guide h2{margin-bottom:0}.energy-option{margin:0;padding:8px}.energy-option p{font-size:11px}.prediction-answer{margin-top:18px}.reading-model .ion-note{max-width:130px}.reading-model .button.primary{min-width:120px}.reading-model .controls{flex-wrap:wrap}.reading-model .actions{margin-left:auto}}
.certificate-panel{padding:30px}.certificate-intro{font-size:15px;line-height:1.6}.certificate-name{display:flex;flex-direction:column;gap:9px;margin:24px 0 12px;max-width:430px;font-size:14px}.certificate-name input{font:inherit;font-size:20px;padding:12px;border:2px solid #c3a4df;border-radius:7px}.certificate-name input[aria-invalid=true]{border-color:var(--error)}#certificate-feedback{color:var(--error);font-size:13px}.certificate-art svg{display:block;width:100%;height:auto}.certificate-actions{justify-content:center;flex-wrap:wrap;margin-top:22px}.ion-lab .controls{flex-wrap:wrap}.ion-lab .actions{margin-left:auto}.ion-lab .ion-note{max-width:none}.certificate-panel .actions{flex-wrap:wrap}
@media(max-width:650px){.ion-lab .controls{justify-content:flex-end}.ion-lab .ion-note{width:100%;max-width:none}.ion-lab .actions{width:100%;justify-content:space-between}.ion-lab .button{padding:9px 10px;font-size:11px}.ion-lab .button.primary{min-width:0}.certificate-panel{padding:20px 15px}.certificate-actions .button{font-size:11px;padding:9px}.certificate-panel h1{font-size:23px}}
@media print{@page{size:landscape;margin:10mm}body{padding:0;background:white}.certificate-panel{max-width:none;width:100%;padding:0;border:0;background:white}.certificate-actions,.certificate-panel>.ion-help{display:none!important}.certificate-art{break-inside:avoid}.certificate-art svg{max-height:175mm;width:100%}}
