:root{
 --bg:#06111b;--panel:#0b1b29cc;--panel2:#0e2232;--text:#ecf7ff;--muted:#90a8b9;--line:#213a4b;
 --accent:#68d6ff;--shadow:0 24px 70px #0008;
 --alkali:#61b8ff;--alkaline:#7ed8ff;--transition:#8aaec2;--post:#b6bacb;--metalloid:#dbc77e;
 --nonmetal:#8ed8bd;--halogen:#54d99c;--noble:#f2b690;--lanthanide:#9dc6d8;--actinide:#83b7d3;
 font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif
}
*{box-sizing:border-box}html{background:var(--bg);scroll-behavior:smooth}body{margin:0;color:var(--text);background:
 radial-gradient(circle at 16% 3%,#0e3348 0,transparent 28%),radial-gradient(circle at 88% 18%,#173a34 0,transparent 26%),#06111b;min-height:100vh}
button,input,select{font:inherit}.ambient{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:-1}.ambient i{position:absolute;width:34vw;height:34vw;border-radius:50%;filter:blur(100px);opacity:.11;background:#65d9ff}.ambient i:nth-child(1){left:-10vw;top:10vh}.ambient i:nth-child(2){right:-8vw;top:42vh;background:#5cffad}.ambient i:nth-child(3){left:35vw;bottom:-18vw;background:#d7a4ff}
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px clamp(16px,4vw,60px);background:#06111be8;border-bottom:1px solid #ffffff12;backdrop-filter:blur(20px)}
.back-btn,.lang-btn{border:1px solid #ffffff20;background:#ffffff09;color:var(--text);border-radius:14px;min-height:44px;padding:10px 14px;cursor:pointer;transition:.2s}.back-btn:hover,.lang-btn:hover{transform:translateY(-2px);border-color:#66d5ff88;background:#66d5ff12}.brand{display:flex;align-items:center;gap:10px}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;font-weight:900;background:linear-gradient(145deg,#45cfff,#6d78ff);box-shadow:0 10px 30px #4ab8ff44}.brand div{display:grid}.brand b{font-size:17px}.brand small{color:var(--muted)}.top-actions{display:flex;gap:8px}.lang-btn.active{background:#5bcaff;color:#042031;border-color:#8bddff;font-weight:900}
main{width:min(1520px,94vw);margin:auto;padding-bottom:80px}.hero{min-height:360px;display:grid;grid-template-columns:1.25fr .75fr;align-items:center;gap:30px;padding:46px clamp(8px,3vw,40px)}.eyebrow,.kicker{font-size:12px;letter-spacing:.18em;font-weight:900;color:#72dbff}.hero h1{font-size:clamp(42px,6vw,86px);line-height:.98;margin:10px 0 18px;max-width:900px}.hero p{max-width:760px;font-size:clamp(16px,1.5vw,22px);color:#b4c7d4;line-height:1.7}.hero-stats{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}.hero-stats div{min-width:120px;padding:12px 18px;border:1px solid #ffffff18;border-radius:18px;background:#ffffff08;backdrop-filter:blur(10px)}.hero-stats b{font-size:24px;margin-inline-end:7px}.hero-stats span{color:var(--muted)}
.hero-atom{position:relative;width:min(330px,70vw);aspect-ratio:1;margin:auto;filter:drop-shadow(0 30px 55px #27caff25)}.nucleus{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:112px;height:112px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#fff,#62d3ff 24%,#0b6eb4 55%,#062943 75%);box-shadow:inset -18px -18px 30px #002b4f88,0 0 80px #42d5ff77}.nucleus span{font-size:52px;color:#022137}.orbit{position:absolute;inset:9%;border:2px solid #9be8ff77;border-radius:50%;animation:spin 9s linear infinite}.orbit b{position:absolute;width:16px;height:16px;border-radius:50%;background:#dffaff;box-shadow:0 0 22px #74e7ff;left:4%;top:50%}.orbit.o2{transform:rotate(60deg);animation-duration:12s}.orbit.o3{transform:rotate(120deg);animation-duration:15s}.orbit.o2 b{left:72%;top:3%}.orbit.o3 b{left:80%;top:74%}@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){*{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}}
.control-panel{position:sticky;top:73px;z-index:22;padding:14px;background:#071722e8;border:1px solid #ffffff14;border-radius:22px;box-shadow:0 16px 50px #0005;backdrop-filter:blur(18px);margin-bottom:28px}.search-wrap{display:flex;align-items:center;gap:10px;background:#020a11aa;border:1px solid #ffffff16;border-radius:15px;padding:0 14px}.search-wrap input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:#fff;padding:13px 4px}.search-wrap button{border:0;background:transparent;color:#8ea6b6;font-size:22px;cursor:pointer}.mode-tabs,.filters{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.mode,.filter-chip{border:1px solid #ffffff18;background:#ffffff08;color:#cfe0eb;padding:8px 13px;border-radius:999px;cursor:pointer;transition:.18s}.mode.active,.mode:hover{background:#5ed0ff;color:#052132;border-color:#8be0ff}.filter-chip.active{outline:2px solid var(--chip);background:color-mix(in srgb,var(--chip) 24%,#071722)}.filter-chip i{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--chip);margin-inline-end:5px}
.mode-view{display:none}.mode-view.active{display:block;animation:rise .35s ease}@keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}.section-head{display:flex;justify-content:space-between;align-items:end;gap:16px;margin:32px 4px 16px}.section-head h2{font-size:clamp(26px,3vw,40px);margin:4px 0}.visible-count{display:flex;align-items:baseline;gap:7px;color:var(--muted)}.visible-count b{font-size:30px;color:#fff}
.table-shell{position:relative;border:1px solid #ffffff14;border-radius:26px;padding:18px;background:linear-gradient(180deg,#0a1a27de,#06131dd9);box-shadow:var(--shadow);overflow:hidden}.periodic-scroll{overflow:auto;padding:18px 4px 22px;scrollbar-color:#365b70 #07131d}.periodic-grid{min-width:1240px;display:grid;grid-template-columns:repeat(18,minmax(60px,1fr));grid-template-rows:repeat(7,98px) 26px 98px 98px;gap:7px;perspective:1200px}.element-card{position:relative;border:1px solid #ffffff38;border-radius:10px;padding:7px 7px 6px;color:#04131c;background:linear-gradient(145deg,color-mix(in srgb,var(--element) 94%,#fff),color-mix(in srgb,var(--element) 78%,#486270));box-shadow:inset 1px 1px 0 #ffffffb0,inset -6px -7px 12px #173b4c25,0 7px 14px #0006;cursor:pointer;overflow:hidden;transform-style:preserve-3d;transition:transform .2s,filter .2s,opacity .2s;animation:tileIn .45s both;animation-delay:calc(var(--i)*5ms)}.element-card:before{content:"";position:absolute;inset:0;background:linear-gradient(120deg,#fff9,transparent 28%,transparent 68%,#fff3);opacity:.45}.element-card:hover,.element-card:focus-visible{z-index:4;transform:translateY(-8px) rotateX(7deg) rotateY(-5deg) scale(1.08);filter:saturate(1.2) brightness(1.09);outline:2px solid #fff}.element-card.dim{opacity:.1;filter:grayscale(.75)}.element-card.hit{box-shadow:0 0 0 2px #fff,0 0 30px var(--element)}@keyframes tileIn{from{opacity:0;transform:translateY(18px) rotateX(30deg) scale(.8)}to{opacity:1;transform:none}}.atomic-num{position:relative;z-index:1;font-size:10px;font-weight:800}.el-symbol{position:relative;z-index:1;font-size:29px;line-height:1;font-weight:850;display:block;text-align:center;margin:4px 0 2px}.el-name{position:relative;z-index:1;display:block;font-size:9px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}.series-marker{display:grid;place-items:center;border:1px dashed #6ca5bb66;border-radius:10px;color:#8eb0c0;background:#0c2431aa;font-size:11px}.group-numbers{display:none}
.el-thumb{position:absolute;z-index:1;right:6px;top:5px;width:30px;height:30px;border-radius:9px;object-fit:cover;border:1px solid #ffffff8a;box-shadow:0 3px 9px #0005;background:#0a1a24;transform-origin:center}
html[dir="rtl"] .el-thumb{right:auto;left:6px}
.favorite-indicator{position:absolute;z-index:2;right:5px;bottom:4px;font-size:11px;color:#5a4410;text-shadow:0 1px 0 #fff8;opacity:.9}
html[dir="rtl"] .favorite-indicator{right:auto;left:5px}
.element-card.anim-float:hover .el-thumb,.element-card.anim-float:focus-visible .el-thumb{animation:thumbFloat calc(2.8s + var(--motion)*.13s) ease-in-out infinite}
.element-card.anim-pulse:hover .el-thumb,.element-card.anim-pulse:focus-visible .el-thumb{animation:thumbPulse calc(2.2s + var(--motion)*.1s) ease-in-out infinite}
.element-card.anim-orbit:hover .el-thumb,.element-card.anim-orbit:focus-visible .el-thumb{animation:thumbOrbit calc(5.5s + var(--motion)*.16s) linear infinite}
.element-card.anim-shimmer:hover .el-thumb,.element-card.anim-shimmer:focus-visible .el-thumb{animation:thumbShimmer calc(3s + var(--motion)*.12s) ease-in-out infinite}
@media(hover:none){.element-card .el-thumb{animation:none!important}}
@keyframes thumbFloat{50%{transform:translateY(-4px) rotate(2deg);filter:brightness(1.12)}}
@keyframes thumbPulse{50%{transform:scale(1.12);filter:drop-shadow(0 0 7px var(--element)) brightness(1.12)}}
@keyframes thumbOrbit{50%{transform:rotate(180deg) scale(.94)}to{transform:rotate(360deg)}}
@keyframes thumbShimmer{0%,100%{filter:brightness(.95)}45%{filter:brightness(1.35) saturate(1.18);transform:translateY(-2px)}}

.legend{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.legend button{border:1px solid #ffffff16;background:#ffffff07;color:#c9dbe6;border-radius:12px;padding:8px 11px;cursor:pointer}.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;background:var(--legend);margin-inline-end:5px}
.family-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.family-card{padding:20px;border:1px solid #ffffff18;border-radius:20px;background:linear-gradient(145deg,color-mix(in srgb,var(--family) 17%,#0c1c29),#08141f);min-height:160px;box-shadow:0 14px 35px #0004}.family-card .family-dot{width:32px;height:8px;border-radius:20px;background:var(--family);box-shadow:0 0 20px var(--family)}.family-card h3{margin:18px 0 8px}.family-card p{color:#9eb4c2;line-height:1.65;margin:0}.lesson-card{display:flex;gap:20px;align-items:center;padding:24px;margin-top:18px;border:1px solid #ffffff18;border-radius:22px;background:#ffffff08}.lesson-icon{font-size:42px}.lesson-card h3{margin:0 0 7px}.lesson-card p{margin:0;color:#a9bdca;line-height:1.7}
.quiz-card{max-width:820px;margin:55px auto;padding:28px;border-radius:26px;background:linear-gradient(145deg,#0d2534,#081722);border:1px solid #ffffff1c;box-shadow:var(--shadow)}.quiz-top{display:flex;justify-content:space-between}.quiz-card h2{font-size:clamp(28px,4vw,48px);margin:34px 0 24px}.quiz-answers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.quiz-answer{min-height:62px;border-radius:17px;border:1px solid #ffffff20;background:#ffffff08;color:#fff;cursor:pointer;padding:14px;text-align:start}.quiz-answer:hover{border-color:#5bd4ff}.quiz-answer.correct{background:#2c9c6f55;border-color:#62efb4}.quiz-answer.wrong{background:#c34b5b55;border-color:#ff8090}.quiz-feedback{min-height:34px;padding:12px 0;color:#b7cad6}.primary,.secondary{border:0;border-radius:15px;padding:12px 18px;font-weight:850;cursor:pointer}.primary{background:linear-gradient(135deg,#52d6ff,#6e86ff);color:#03131f}.secondary{background:#ffffff0d;color:#e9f7ff;border:1px solid #ffffff20}.primary:hover,.secondary:hover{filter:brightness(1.12)}
.chem-tools{margin-top:46px}.tools-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.tool-card{padding:22px;border:1px solid #ffffff18;border-radius:22px;background:#091925cc}.tool-title{display:flex;gap:12px;align-items:center}.tool-title>span{font-size:30px}.tool-title div{display:grid}.tool-title small{color:var(--muted);margin-top:3px}.select-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0 10px}select{width:100%;min-width:0;background:#06131e;color:#fff;border:1px solid #ffffff22;border-radius:12px;padding:11px}.compare-result{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}.mini-element{padding:13px;border-radius:14px;background:#ffffff08;border:1px solid #ffffff13}.mini-element b{font-size:22px}.mini-element span{display:block;color:#9db3c2;font-size:13px;margin-top:5px}.combine-result{margin-top:14px;min-height:58px;padding:14px;border-radius:14px;background:#06131e;border:1px solid #ffffff13;line-height:1.6}.combine-result strong{color:#7ae1ff;font-size:22px}.safety-note{color:#7891a2;font-size:12px;line-height:1.5}
.element-modal{position:fixed;inset:0;z-index:80;display:none}.element-modal.open{display:block}.modal-backdrop{position:absolute;inset:0;background:#02070bcf;backdrop-filter:blur(10px)}.element-sheet{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(980px,94vw);max-height:90vh;overflow:auto;display:grid;grid-template-columns:.9fr 1.1fr;border-radius:28px;border:1px solid #ffffff25;background:#091924;box-shadow:0 40px 100px #000b;animation:sheetIn .28s ease}@keyframes sheetIn{from{opacity:0;transform:translate(-50%,-46%) scale(.95)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}.modal-close{position:absolute;right:14px;top:14px;z-index:3;width:42px;height:42px;border-radius:14px;border:1px solid #ffffff25;background:#06131dcc;color:#fff;font-size:24px;cursor:pointer}.element-visual-wrap{min-height:500px;display:grid;place-items:center;background:radial-gradient(circle at 50% 45%,#17475b,#07141e 67%);overflow:hidden}.element-visual-wrap img{width:88%;max-width:430px;filter:drop-shadow(0 30px 45px #0009);animation:float 5s ease-in-out infinite}@keyframes float{50%{transform:translateY(-11px) rotate(1deg)}}
.element-visual-wrap{position:relative}
.visual-note{position:absolute;left:14px;top:14px;z-index:2;padding:6px 9px;border-radius:999px;border:1px solid #ffffff24;background:#06131dcc;color:#a9bfcd;font-size:11px;backdrop-filter:blur(8px)}
html[dir="rtl"] .visual-note{left:auto;right:14px}
.visual-animation-btn{position:absolute;left:50%;bottom:18px;z-index:2;transform:translateX(-50%);border:1px solid #ffffff2c;background:#06131de6;color:#edf9ff;border-radius:999px;padding:9px 14px;cursor:pointer;box-shadow:0 10px 24px #0005;backdrop-filter:blur(10px)}
.element-visual-wrap.anim-float img{animation:elementFloat 3.7s ease-in-out infinite}
.element-visual-wrap.anim-pulse img{animation:elementPulse 2.8s ease-in-out infinite}
.element-visual-wrap.anim-orbit img{animation:elementOrbit 8s ease-in-out infinite}
.element-visual-wrap.anim-shimmer img{animation:elementShimmer 4s ease-in-out infinite}
.element-visual-wrap.paused img{animation-play-state:paused!important}
@keyframes elementFloat{50%{transform:translateY(-16px) rotate(1.8deg) scale(1.015)}}
@keyframes elementPulse{50%{transform:scale(1.045);filter:drop-shadow(0 34px 55px #0009) brightness(1.17)}}
@keyframes elementOrbit{25%{transform:translateX(7px) rotate(1deg)}50%{transform:translateY(-9px) rotate(-1deg)}75%{transform:translateX(-7px) rotate(.5deg)}}
@keyframes elementShimmer{45%{filter:drop-shadow(0 30px 45px #0009) brightness(1.32) saturate(1.12);transform:translateY(-7px)}}
.detail-actions{display:grid;grid-template-columns:auto 1fr;gap:10px;margin-top:24px}
.favorite-btn{border:1px solid #ffffff22;background:#ffffff08;color:#fff;border-radius:15px;padding:12px 16px;font-weight:800;cursor:pointer;white-space:nowrap}
.favorite-btn.active{background:#ffd76a;color:#2d2306;border-color:#ffe49a}
.element-detail{padding:34px}.detail-head{display:flex;gap:8px;align-items:center}.detail-number,.detail-category{padding:6px 10px;border-radius:999px;background:#ffffff0b;border:1px solid #ffffff18;color:#aec2cf;font-size:12px}.symbol-lockup{display:flex;align-items:center;gap:20px;margin:20px 0}.symbol-lockup strong{font-size:84px;line-height:1}.symbol-lockup h2{font-size:36px;margin:0}.symbol-lockup span{color:var(--muted)}.property-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.property-grid>div{padding:13px;border-radius:14px;background:#ffffff08}.property-grid small{display:block;color:#8da5b5;margin-bottom:5px}.detail-copy{margin-top:22px}.detail-copy h3{margin-bottom:7px}.detail-copy p{color:#abc0cd;line-height:1.75;margin:0}
html[dir="rtl"] body{text-align:right}html[dir="rtl"] .modal-close{right:auto;left:14px}html[dir="rtl"] .element-card:hover{transform:translateY(-8px) rotateX(7deg) rotateY(5deg) scale(1.08)}
@media(max-width:900px){.hero{grid-template-columns:1fr;text-align:center}.hero p{margin-inline:auto}.hero-stats{justify-content:center}.hero-atom{width:230px}.tools-grid{grid-template-columns:1fr}.element-sheet{grid-template-columns:1fr}.element-visual-wrap{min-height:300px}.element-visual-wrap img{max-width:290px}.control-panel{top:69px}.back-btn span{display:none}}
@media(max-width:560px){main{width:min(96vw,1520px)}.topbar{padding:10px}.brand small{display:none}.hero{padding:32px 8px}.hero h1{font-size:42px}.hero-atom{width:190px}.control-panel{border-radius:16px}.mode-tabs .mode{flex:1}.quiz-answers{grid-template-columns:1fr}.section-head{align-items:start}.visible-count{display:none}.tool-card{padding:16px}.select-row{grid-template-columns:1fr}.compare-result{grid-template-columns:1fr}.element-detail{padding:24px 18px}.symbol-lockup strong{font-size:66px}.symbol-lockup h2{font-size:28px}.property-grid{grid-template-columns:1fr 1fr}}

@media(max-width:560px){
  .periodic-grid{grid-template-rows:repeat(7,94px) 24px 94px 94px}
  .el-thumb{width:27px;height:27px}
  .detail-actions{grid-template-columns:1fr}
}

@media(max-width:760px){
  .element-card{animation:none!important;transition:transform .12s,filter .12s,opacity .12s}
  .hero-atom .orbit{animation-duration:16s}
}

/* V59: readable illustrated gallery, with the classic table as an option. */
.layout-switch{display:flex;gap:8px;flex-wrap:wrap}.gallery-note{color:var(--muted);font-size:13px}.gallery-grid{min-width:0;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));grid-template-rows:none;gap:18px;perspective:none}.gallery-grid .element-card{grid-column:auto!important;grid-row:auto!important;display:flex;flex-direction:column;align-items:center;padding:12px 12px 20px;border-radius:22px;color:var(--text);background:linear-gradient(145deg,color-mix(in srgb,var(--element) 14%,#0c1b29),#09141f);box-shadow:0 8px 24px #0003;border-color:color-mix(in srgb,var(--element) 28%,transparent);animation-delay:calc(min(var(--i),12)*25ms)}.gallery-grid .element-card:before{display:none}.gallery-grid .el-thumb{position:static;width:100%;height:auto;aspect-ratio:1;border:0;border-radius:16px;box-shadow:none;margin-bottom:12px}.gallery-grid .el-name{font-size:18px;white-space:normal;line-height:1.4}.gallery-grid .el-symbol{display:none}.gallery-grid .atomic-num{position:absolute;top:20px;inset-inline-start:22px;z-index:2;background:#07131dbb;border-radius:8px;padding:3px 7px}.el-family{display:none}.gallery-grid .el-family{display:block;color:var(--muted);font-size:12px;margin-top:6px}.gallery-grid .favorite-indicator{font-size:20px;color:#ffd76a;top:18px;bottom:auto}.gallery-grid .element-card:hover,.gallery-grid .element-card:focus-visible{transform:translateY(-5px);outline:2px solid var(--element)}.gallery-grid .element-card:hover .el-thumb{animation:elementFloat 3.7s ease-in-out infinite}.control-panel{position:relative;top:auto}.topbar{flex-wrap:wrap}.back-btn span{display:inline}.top-actions{margin-inline-start:auto}button:focus-visible{outline:2px solid #7ce7ff;outline-offset:4px}#emptyState{text-align:center;padding:36px;color:var(--muted)}
@media(max-width:600px){.topbar{gap:8px}.brand{display:none}.back-btn,.lang-btn{padding:9px 11px;font-size:13px}.hero{grid-template-columns:1fr auto;min-height:0;gap:8px;padding:26px 8px;text-align:start}.hero h1{font-size:34px;line-height:1.15}.hero p{font-size:15px}.hero-atom{width:90px}.nucleus{width:40px;height:40px}.nucleus span{font-size:24px}.orbit b{width:7px;height:7px}.hero-stats{gap:6px;justify-content:start}.hero-stats div{min-width:0;padding:8px}.hero-stats b{font-size:19px}.hero-stats span{font-size:12px}.gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.table-shell{padding:6px;border-radius:18px}.gallery-grid .element-card{padding:7px 7px 16px;border-radius:15px}.gallery-grid .el-name{font-size:16px}.gallery-grid .el-family{font-size:11px}.gallery-grid .atomic-num{top:12px;inset-inline-start:14px}.element-visual-wrap{min-height:320px}.element-sheet{max-height:92dvh}.section-head h2{font-size:26px}.visible-count{display:flex}.topbar{position:sticky}.hero-copy{min-width:0}}

/* V60: conventional table geometry is never mirrored by Arabic text. */
.periodic-scroll{direction:ltr;padding-top:10px}.periodic-grid{direction:ltr;grid-template-columns:repeat(18,minmax(62px,1fr));grid-template-rows:repeat(7,112px) 22px 112px 112px;gap:7px;min-width:1240px}.group-numbers{display:grid;direction:ltr;grid-template-columns:repeat(18,minmax(62px,1fr));gap:7px;min-width:1240px;text-align:center;color:#92afbf;font-size:11px;padding-bottom:10px}.group-numbers[hidden]{display:none}.periodic-grid:not(.gallery-grid) .element-card{border-radius:9px;padding:8px 3px;display:flex;flex-direction:column;justify-content:center;align-items:center;animation:tileIn .4s backwards;animation-delay:calc(min(var(--i),18)*15ms)}.periodic-grid:not(.gallery-grid) .element-card.hit{box-shadow:inset 1px 1px 0 #ffffff9c,0 5px 12px #0005}.periodic-grid:not(.gallery-grid) .atomic-num{position:absolute;left:5px;top:5px;font-size:10px}.periodic-grid:not(.gallery-grid) .el-thumb{position:absolute;top:4px;right:4px;left:auto;width:25px;height:25px;border-radius:7px}.periodic-grid:not(.gallery-grid) .el-symbol{font-size:27px;margin:24px 0 5px;line-height:1;font-weight:900}.periodic-grid:not(.gallery-grid) .el-name{font-size:10px;line-height:1.2;white-space:normal;overflow-wrap:anywhere;max-width:100%;min-height:24px}.periodic-grid:not(.gallery-grid) .dim{opacity:.17;animation:none;filter:grayscale(.9)}.periodic-grid:not(.gallery-grid) .element-card:hover,.periodic-grid:not(.gallery-grid) .element-card:focus-visible,.periodic-grid:not(.gallery-grid) .selected-element{transform:translateY(-10px) scale(1.1);z-index:5;box-shadow:0 16px 25px #0008,0 0 20px var(--element);outline:2px solid #fff}.element-modal.open .element-sheet{animation:sheetLift .35s cubic-bezier(.18,.85,.25,1) both}.element-modal.open .modal-backdrop{animation:backdropIn .25s both}@keyframes sheetLift{from{opacity:0;transform:translate(-50%,calc(-50% + 65px)) scale(.94)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes backdropIn{from{opacity:0}to{opacity:1}}.property-filters{border-top:1px solid #ffffff12;padding-top:12px}.gallery-grid{min-width:0;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));grid-template-rows:none;direction:inherit}.gallery-grid .el-symbol{display:block;font-size:25px;margin:0 0 5px}.gallery-grid .el-name{font-size:17px}.hero{min-height:240px;padding-block:28px}.hero h1{font-size:clamp(36px,4vw,60px)}.hero-atom{width:210px}.hero p{font-size:17px}.series-marker{color:#b6d5e3;font-size:12px}.element-card:active{transform:translateY(-10px) scale(1.04)}
@media(max-width:600px){.periodic-scroll{overscroll-behavior-x:contain}.gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hero-atom{width:90px}.hero h1{font-size:32px}.hero p{font-size:15px}.brand{display:flex}.brand small{display:block}.topbar{flex-wrap:nowrap}.property-filters{gap:6px}.filter-chip{min-height:38px}.element-modal.open .element-sheet{animation:sheetLift .32s ease both}}
@media(prefers-reduced-motion:reduce){.element-card,.element-sheet,.modal-backdrop{animation:none!important;transition:none!important}}

/* ================= CLASSORA V78 FIT-TABLE + TOUCH ================= */
html,body{touch-action:manipulation;-ms-touch-action:manipulation}
.pt-icon{width:1.05em;height:1.05em;display:inline-block;vertical-align:-.16em;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.nucleus .pt-icon{width:34px;height:34px;vertical-align:middle}
.mode .pt-icon,.visual-animation-btn .pt-icon{width:18px;height:18px;margin-inline-end:6px}
.lesson-icon .pt-icon,.tool-title>span .pt-icon{width:34px;height:34px}
.visual-animation-btn{display:flex;align-items:center;justify-content:center;gap:5px}

/* Keep all 18 columns visible on tablets and phones instead of horizontal scrolling. */
@media(max-width:1100px){
  .periodic-scroll{overflow-x:hidden!important;overflow-y:visible!important;padding-inline:0!important}
  .periodic-grid:not(.gallery-grid),.group-numbers{
    width:100%!important;min-width:0!important;
    grid-template-columns:repeat(18,minmax(0,1fr))!important;
    gap:3px!important
  }
  .periodic-grid:not(.gallery-grid){grid-template-rows:repeat(7,70px) 16px 70px 70px!important}
  .group-numbers{font-size:7px!important;gap:3px!important}
  .periodic-grid:not(.gallery-grid) .element-card{
    min-width:0!important;border-radius:5px!important;padding:3px 1px!important;overflow:hidden!important
  }
  .periodic-grid:not(.gallery-grid) .atomic-num{left:2px!important;top:2px!important;font-size:6px!important}
  .periodic-grid:not(.gallery-grid) .el-thumb{top:2px!important;right:2px!important;width:13px!important;height:13px!important;border-radius:4px!important}
  .periodic-grid:not(.gallery-grid) .el-symbol{font-size:16px!important;margin:17px 0 2px!important}
  .periodic-grid:not(.gallery-grid) .el-name{font-size:6px!important;line-height:1.05!important;min-height:12px!important;overflow:hidden!important}
  .series-marker{font-size:7px!important;border-radius:5px!important}
}
@media(max-width:700px){
  main{width:calc(100vw - 10px)!important;max-width:none!important}
  .table-shell{padding:4px!important;border-radius:14px!important}
  .periodic-grid:not(.gallery-grid),.group-numbers{gap:1.5px!important}
  .periodic-grid:not(.gallery-grid){grid-template-rows:repeat(7,48px) 10px 48px 48px!important}
  .group-numbers{font-size:5px!important;gap:1.5px!important;padding-bottom:5px!important}
  .periodic-grid:not(.gallery-grid) .element-card{border-radius:3px!important;padding:1px!important;border-width:1px!important}
  .periodic-grid:not(.gallery-grid) .atomic-num{font-size:4.7px!important;left:1px!important;top:1px!important}
  .periodic-grid:not(.gallery-grid) .el-thumb{width:8px!important;height:8px!important;top:1px!important;right:1px!important;border-radius:2px!important}
  .periodic-grid:not(.gallery-grid) .el-symbol{font-size:10px!important;margin:12px 0 1px!important;letter-spacing:-.5px}
  .periodic-grid:not(.gallery-grid) .el-name{font-size:4.4px!important;line-height:1!important;min-height:8px!important;white-space:nowrap!important;text-overflow:clip!important}
  .series-marker{font-size:5px!important;border-radius:3px!important}
  .periodic-grid:not(.gallery-grid) .element-card:hover,
  .periodic-grid:not(.gallery-grid) .element-card:focus-visible,
  .periodic-grid:not(.gallery-grid) .selected-element{transform:scale(1.22)!important}
}
@media(max-width:430px){
  .periodic-grid:not(.gallery-grid){grid-template-rows:repeat(7,42px) 8px 42px 42px!important}
  .periodic-grid:not(.gallery-grid) .el-symbol{font-size:9px!important;margin-top:10px!important}
  .periodic-grid:not(.gallery-grid) .el-name{font-size:4px!important}
}

.periodic-fit-content{direction:ltr}.periodic-scroll{max-width:100%;box-sizing:border-box}.table-shell{min-width:0;overflow:hidden}#tableFitToggle{min-height:44px}.gallery-grid .element-card{min-height:44px}


/* V91: viewport-fit periodic table. The full 18-column table stays centered and scales to the device. */
main{width:min(1640px,calc(100vw - 20px))}
.explore-view{min-width:0}
.table-shell{width:100%;padding:clamp(6px,1.1vw,16px)}
.periodic-scroll{width:100%;max-width:100%;padding:clamp(4px,.8vw,12px) 2px 8px;overscroll-behavior:contain}
.periodic-fit-content{width:max-content;max-width:none;will-change:transform}
@media(max-height:900px) and (min-width:760px){
  .section-head{margin:18px 4px 10px}
  .layout-switch{margin-bottom:4px}
  .gallery-note{margin:5px 0}
  .control-panel{padding:10px;margin-bottom:16px}
}
@media(max-width:700px){
  main{width:calc(100vw - 6px)!important}
  .section-head{margin:14px 3px 8px}
  .section-head h2{font-size:22px}
  .layout-switch{gap:5px}
  .layout-switch .lang-btn{min-height:38px;padding:7px 9px;font-size:11px}
  .gallery-note{margin:4px 2px 7px}
  .periodic-scroll{padding:2px 0 4px}
}


/* ================= CLASSORA V98 LARGE RESPONSIVE PERIODIC TABLE ================= */
.explore-view{display:flex;flex-direction:column;align-items:stretch}
.explore-view .section-head,.explore-view .layout-switch,.explore-view .gallery-note,.explore-view .legend,#emptyState{width:100%}
.table-shell{width:min(1500px,100%);margin-inline:auto;padding:clamp(10px,1.1vw,18px)!important;border-radius:28px!important;background:
 radial-gradient(circle at 50% 0,rgba(72,190,255,.075),transparent 38%),
 linear-gradient(180deg,#0a1a27f2,#06131dea);box-shadow:0 28px 70px rgba(0,0,0,.28),inset 0 1px rgba(255,255,255,.035)}
.periodic-scroll{width:100%;margin-inline:auto;min-height:clamp(320px,48vw,880px)}
.periodic-fit-content{margin-inline:auto}
.periodic-fit-content .periodic-grid:not(.gallery-grid),
.periodic-fit-content .group-numbers{
  width:1240px!important;
  min-width:1240px!important;
  grid-template-columns:repeat(18,minmax(62px,1fr))!important;
  gap:7px!important;
}
.periodic-fit-content .periodic-grid:not(.gallery-grid){
  grid-template-rows:repeat(7,86px) 18px 86px 86px!important;
}
.periodic-fit-content .group-numbers{font-size:10px!important;gap:7px!important;padding-bottom:9px!important}
.periodic-fit-content .periodic-grid:not(.gallery-grid) .element-card{
  min-width:0!important;border-radius:8px!important;padding:6px 3px!important;border-width:1px!important;overflow:hidden!important
}
.periodic-fit-content .periodic-grid:not(.gallery-grid) .atomic-num{font-size:9px!important;left:4px!important;top:4px!important}
.periodic-fit-content .periodic-grid:not(.gallery-grid) .el-thumb{width:22px!important;height:22px!important;top:4px!important;right:4px!important;border-radius:6px!important}
.periodic-fit-content .periodic-grid:not(.gallery-grid) .el-symbol{font-size:25px!important;margin:21px 0 4px!important;letter-spacing:0!important}
.periodic-fit-content .periodic-grid:not(.gallery-grid) .el-name{font-size:9px!important;line-height:1.08!important;min-height:19px!important;white-space:normal!important;text-overflow:ellipsis!important}
.periodic-fit-content .series-marker{font-size:10px!important;border-radius:7px!important}
@media(max-width:900px){
  .table-shell{width:100%;padding:8px!important}
  .periodic-scroll{min-height:clamp(260px,62vw,620px)}
}
@media(max-width:600px){
  .table-shell{padding:5px!important;border-radius:16px!important}
  .periodic-scroll{min-height:clamp(190px,58vw,360px)}
  .periodic-fit-content .periodic-grid:not(.gallery-grid) .el-name{display:none!important}
  .periodic-fit-content .periodic-grid:not(.gallery-grid) .el-thumb{display:none!important}
  .periodic-fit-content .periodic-grid:not(.gallery-grid) .el-symbol{font-size:30px!important;margin:14px 0 0!important}
  .periodic-fit-content .periodic-grid:not(.gallery-grid) .atomic-num{font-size:9px!important}
}


/* ================= CLASSORA V99.4 PERIODIC MOBILE UNFREEZE ================= */
/* The periodic page lives inside a full-screen same-origin iframe. Keep the
   document itself as the vertical scroller and never trap touch gestures in
   the scaled table. */
html{height:auto!important;min-height:100%!important;overflow-y:auto!important;overscroll-behavior-y:auto!important}
body{height:auto!important;min-height:100dvh!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-y:auto!important}
main{overflow:visible!important}
.periodic-scroll{touch-action:pan-y!important;-webkit-overflow-scrolling:touch}
.periodic-fit-content{will-change:auto!important}
.element-card .el-thumb{contain:paint}

@media(max-width:760px){
  html,body{touch-action:pan-y!important}
  /* Exit control stays visible even after a long scroll. */
  .topbar{
    position:fixed!important;
    top:0!important;left:0!important;right:0!important;
    z-index:1000!important;
    min-height:58px!important;
    padding:max(8px,env(safe-area-inset-top)) 10px 8px!important;
    background:#06111bf5!important;
    border-bottom:1px solid #ffffff18!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }
  main{padding-top:calc(62px + env(safe-area-inset-top))!important;padding-bottom:110px!important}
  .back-btn{
    display:flex!important;align-items:center!important;justify-content:center!important;
    min-height:44px!important;min-width:116px!important;
    position:relative!important;z-index:2!important;
    touch-action:manipulation!important;
  }
  .back-btn span{display:inline!important}
  .control-panel{position:relative!important;top:auto!important}
  .element-modal{z-index:1200!important}
  .element-sheet{
    top:max(8px,env(safe-area-inset-top))!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    transform:translateX(-50%)!important;
    max-height:none!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  @keyframes sheetIn{from{opacity:0;transform:translateX(-50%) translateY(12px) scale(.98)}to{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}}
}


/* ================= V100 PERIODIC PAGE SCROLL / EXIT HOTFIX ================= */
html,body{
  width:100%!important;
  height:100%!important;
  min-height:100%!important;
  overflow:hidden!important;
}
body{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  overscroll-behavior:none!important;
}
.ambient{position:fixed!important}
.topbar{
  position:relative!important;
  top:auto!important;
  grid-row:1!important;
  flex:0 0 auto!important;
  z-index:100!important;
}
main{
  grid-row:2!important;
  width:min(1520px,94vw)!important;
  height:100%!important;
  min-height:0!important;
  margin:0 auto!important;
  padding-bottom:max(90px,env(safe-area-inset-bottom))!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior-y:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y pinch-zoom!important;
  scrollbar-gutter:stable!important;
}
.control-panel{top:8px!important}
@media(max-width:560px){
  main{width:100%!important;padding-inline:10px!important}
  .topbar{padding:max(8px,env(safe-area-inset-top)) 10px 8px!important}
}


/* ================= CLASSORA V100.2 STABLE PERIODIC SCROLL ================= */
/* Keep the page scroller stable while allowing wheel/touch gestures that start
   over the periodic table to continue vertically through the page. */
main{
  overscroll-behavior-y:auto!important;
}
.periodic-scroll{
  overscroll-behavior-x:contain!important;
  overscroll-behavior-y:auto!important;
  touch-action:pan-x pan-y!important;
}
.back-btn{
  touch-action:manipulation!important;
  pointer-events:auto!important;
}
