/* Explore the Elements — layout on top of the shared cosmic shell (shell.css) */
html, body { height: 100%; }
body { overflow: hidden; }
.page { height: 100vh; height: 100dvh; padding-top: var(--nav-h); display: flex; flex-direction: column; }
.muted { color: var(--muted); } .small { font-size: .78rem; }
.na { color: #64748b; font-style: italic; font-size: .92em; }
a { color: var(--cyan); }
h3 { font-family: Cinzel, serif; color: var(--gold); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .4rem; }
h4 { font-family: "Playfair Display", serif; font-style: italic; color: var(--gold-light); font-weight: 400; margin: .7rem 0 .2rem; font-size: .95rem; }

/* metadata menu */
.metabar { position: relative; z-index: 3; display: flex; gap: 1rem; align-items: center; padding: .5rem 1.5rem; border-bottom: 1px solid var(--border); background: rgba(8,10,28,.55); flex-wrap: wrap; transition: opacity 1.5s, transform 1.5s; }
.metabar-tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.metabar-tabs button { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: .28rem .8rem; font-size: .75rem; letter-spacing: .05em; cursor: pointer; transition: all .25s; }
.metabar-tabs button:hover { color: var(--text); border-color: var(--purple); }
.metabar-tabs button[aria-selected="true"] { background: rgba(139,92,246,.25); color: #fff; border-color: var(--purple); box-shadow: 0 0 12px rgba(139,92,246,.35); }
.metabar-viz { flex: 1; min-width: 260px; display: flex; align-items: center; gap: .8rem; }
#spark { flex: 1; height: 34px; min-width: 120px; }
.scale { font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.scale .sw { width: 60px; height: 8px; border-radius: 4px; display: inline-block; }

/* table mode stage */
.stage { position: relative; z-index: 2; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(170px, 15vw) 1fr minmax(170px, 15vw); grid-template-rows: 1fr auto; gap: .5rem 1rem; padding: .6rem 1.2rem 3.4rem; }
.table-wrap { position: relative; z-index: 6; min-height: 0; display: flex; align-items: center; justify-content: center; }
#ptable { width: 100%; height: 100%; max-height: 100%; transform-origin: 0 0; overflow: visible; }
.edge { font-size: .76rem; transition: opacity 1.5s cubic-bezier(.65,.05,.25,1), transform 1.5s cubic-bezier(.65,.05,.25,1); opacity: 0; overflow: auto; align-self: center; max-height: 100%; }
.stage.has-info .edge { opacity: 1; }
.edge-left { transform: translateX(-12px); } .edge-right { transform: translateX(12px); }
.stage.has-info .edge-left, .stage.has-info .edge-right { transform: none; }
.edge-bottom { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1fr; gap: 1.2rem; height: 5.2em; line-height: 1.45; color: var(--muted); }
.edge-bottom b { color: var(--gold); font-weight: 600; }
.edge-bottom ul.vl { display: inline; } .edge-bottom ul.vl li { display: inline; } .edge-bottom ul.vl li+li::before { content: " · "; }
.kv { display: flex; flex-direction: column; padding: .28rem 0; border-bottom: 1px solid rgba(139,92,246,.1); }
.kv .k { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.kv .v { color: var(--text); overflow-wrap: anywhere; }
ul.vl { list-style: none; } ul.vl li { padding-left: .8em; text-indent: -.8em; } ul.vl li::before { content: "• "; color: var(--purple); }
dl.vo { display: grid; grid-template-columns: auto 1fr; gap: 0 .6rem; } dl.vo dt { color: var(--muted); } .src { color: var(--muted); font-size: .85em; }

/* svg cells */
.cell { cursor: pointer; transition: opacity .35s, transform .35s; outline: none; }
.cell .bg { fill: var(--c); fill-opacity: .16; stroke: var(--c); stroke-opacity: .55; stroke-width: 1.5; transition: fill-opacity .3s, stroke-width .3s; }
.cell .sheen { pointer-events: none; }
.t-z { font: 500 15px Inter, sans-serif; fill: var(--muted); }
.t-sym { font: 700 40px "Playfair Display", serif; text-anchor: middle; fill: var(--c, var(--text)); }
.t-name { font: 500 11.5px Inter, sans-serif; text-anchor: middle; fill: var(--text); }
.t-mass { font: 400 11px Inter, sans-serif; text-anchor: middle; fill: var(--muted); }
.ph-t { font: 600 16px Inter, sans-serif; text-anchor: middle; fill: var(--muted); }
.glabel { font: 600 20px Cinzel, serif; fill: var(--muted); text-anchor: middle; transition: fill .3s; }
.plabel { font: 600 18px Cinzel, serif; fill: #475569; text-anchor: end; }
.blabel path { fill: none; stroke: #475569; stroke-width: 2; transition: stroke .3s; }
.blabel text { font: 600 18px Cinzel, serif; fill: #64748b; text-anchor: middle; letter-spacing: .1em; transition: fill .3s; }
.legend text { font: 400 15px Inter, sans-serif; fill: var(--muted); transition: fill .3s; }
.legend .in-group text { fill: var(--gold-light); }
#ptable.hovering .cell { opacity: .38; }
#ptable.hovering .cell.in-block { opacity: .7; }
#ptable.hovering .cell.in-group { opacity: .95; }
#ptable.hovering .cell.in-group .bg { fill-opacity: .3; }
#ptable .cell.on { opacity: 1; filter: url(#glow); }
#ptable .cell.on .bg { fill-opacity: .45; stroke-width: 3; stroke: #fff; }
.glabel.in-group { fill: var(--gold); }
.blabel.in-block path { stroke: var(--cyan); } .blabel.in-block text { fill: var(--cyan); }
.cell:focus-visible .bg { stroke: var(--cyan); stroke-width: 3; }

/* hero info in the table gap */
.hero-info { height: 100%; display: flex; align-items: flex-start; gap: 26px; padding: 6px 10px; color: var(--text); font-family: Inter, sans-serif; font-size: 22px; line-height: 1.35; }
.hero-intro h1 { font-family: Cinzel, serif; color: var(--gold); font-size: 64px; letter-spacing: .06em; text-shadow: 0 0 24px rgba(251,191,36,.35); margin-top: 30px; }
.hero-intro p { font-family: "Playfair Display", serif; font-style: italic; font-size: 28px; color: var(--muted); margin-top: 6px; }
.hero-intro .small { font-family: Inter, sans-serif; font-style: normal; font-size: 20px; }
.hero-sym { flex: 0 0 auto; width: 210px; height: 210px; margin-top: 34px; border-radius: 14px; display: grid; place-items: center; font: 700 120px "Playfair Display", serif; color: var(--c); border: 2px solid var(--c); background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.12), rgba(13,16,48,.6)); box-shadow: 0 0 30px color-mix(in srgb, var(--c) 45%, transparent); }
.hero-txt { flex: 1; min-width: 0; padding-top: 24px; }
.hero-name { font: 700 56px Cinzel, serif; color: var(--gold); }
.hero-sub { color: var(--muted); font-size: 21px; margin-bottom: 6px; }
.hero-cfg { font-size: 26px; color: var(--cyan); margin-bottom: 6px; }
.hero-txt .kv { flex-direction: row; gap: 10px; padding: 2px 0; } .hero-txt .kv .k { font-size: 17px; width: 170px; padding-top: 2px; }

/* element mode */
.emode { position: fixed; z-index: 4; left: 0; right: 0; top: var(--nav-h); bottom: 0; padding: 1rem 1.25rem 3.6rem; pointer-events: none; visibility: hidden; transition: visibility 0s 1.5s; }
.mode-element .emode { pointer-events: auto; visibility: visible; transition: visibility 0s; }
.eg { height: 100%; display: grid; gap: .8rem; grid-template-columns: minmax(200px, 23%) 1fr minmax(200px, 23%);
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-areas: "cell orb mini" "ids orb props" "det chem map" "photo econ safety"; }
.slot-cell { grid-area: cell; width: min(var(--cw, 200px), 100%); aspect-ratio: 1; max-height: 24vh; justify-self: start; }
.slot-mini { grid-area: mini; aspect-ratio: 1970 / 1082; width: 100%; align-self: start; position: relative; cursor: pointer; border-radius: 8px; }
.mini-hint { position: absolute; right: 0; bottom: 100%; padding-bottom: .3rem; line-height: 1; white-space: nowrap; opacity: 0; transition: opacity .6s ease; z-index: 2; font-size: .68rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.e-ids { grid-area: ids; } .e-orb { grid-area: orb; } .e-props { grid-area: props; } .e-details { grid-area: det; } .e-map { grid-area: map; } .e-photo { grid-area: photo; } .e-econ { grid-area: econ; } .e-safety { grid-area: safety; }
.panel-e { min-height: 0; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem; font-size: .8rem; backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(24px) scale(.97); transition: opacity 1.5s cubic-bezier(.65,.05,.25,1), transform 1.5s cubic-bezier(.65,.05,.25,1); }
.e-photo, .e-ids { transform: translateX(-30px); } .e-safety, .e-props, .e-map { transform: translateX(30px); } .e-orb { transform: scale(.85); }
.mode-element .panel-e { opacity: 1; transform: none; }
.mode-element .stage .edge, .mode-element .metabar { opacity: 0; pointer-events: none; }
.mode-element .metabar { transform: translateY(-10px); }
.e-name { font: 700 1.7rem Cinzel, serif; color: var(--gold); line-height: 1.1; } .e-sub { color: var(--muted); font-size: .78rem; margin-bottom: .3rem; }
.e-orb { display: grid; grid-template-columns: 1fr auto; gap: .6rem; padding: .4rem; background: radial-gradient(ellipse at center, rgba(139,92,246,.12), rgba(3,4,15,.6)); }
.orb-wrap { position: relative; min-height: 0; min-width: 0; }
#orbCanvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.orb-note { position: absolute; left: .4rem; bottom: 3.4rem; max-width: 46%; font-size: .72rem; color: var(--cyan); pointer-events: none; line-height: 1.35; }
.ion-menu { display: flex; flex-direction: column; gap: .3rem; overflow: auto; padding: .3rem; max-width: 140px; }
.ion-h { font: 600 .7rem Cinzel, serif; color: var(--gold); letter-spacing: .1em; text-transform: uppercase; }
.ion-menu button { background: rgba(13,16,48,.8); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: .3rem .6rem; font: 600 .95rem Cinzel, serif; cursor: pointer; text-align: left; }
.ion-menu button small { font: 400 .65rem Inter, sans-serif; color: var(--muted); }
.ion-menu button[aria-checked="true"] { border-color: var(--cyan); box-shadow: 0 0 10px rgba(34,211,238,.4); }
.prose { line-height: 1.55; color: var(--text); }
.map svg { width: 100%; height: auto; display: block; }
.map path { fill: #1e2347; stroke: #0d1030; stroke-width: .4; }
.map path.src { fill: var(--gold-deep); filter: drop-shadow(0 0 3px rgba(251,191,36,.7)); }
.map-cap { font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.e-photo img { width: 100%; max-height: 48%; object-fit: cover; border-radius: 6px; display: block; }
.photo-empty, .chart-empty { border: 1px dashed var(--border); border-radius: 6px; padding: 1.2rem; text-align: center; color: var(--muted); }
.cap .credit { display: block; font-size: .66rem; color: #64748b; margin-top: .3rem; }
.ghs-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .3rem; }
.ghs { width: 64px; text-align: center; } .ghs svg { width: 44px; height: 44px; }
.ghs .dia { fill: #fff; stroke: #dc2626; stroke-width: 1.6; } .ghs .sym { fill: #111; stroke: #111; stroke-width: .6; }
.ghs figcaption { font-size: .6rem; color: var(--muted); line-height: 1.2; }
.ghs.rad svg { fill: #111; } .ghs.rad .radbg { fill: #facc15; }
.econ-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: .8rem; }
.chart { width: 100%; height: auto; } .chart .line { fill: none; stroke: var(--gold); stroke-width: 2; } .chart .area { fill: rgba(251,191,36,.12); }
.chart circle { fill: var(--gold-light); } .chart text { font-size: 10px; fill: var(--muted); }

/* table → mini */
#ptable.mini .t-z, #ptable.mini .t-sym, #ptable.mini .t-name, #ptable.mini .t-mass, #ptable.mini .ph-t, #ptable.mini .glabel, #ptable.mini .plabel, #ptable.mini .block-labels, #ptable.mini .legend, #ptable.mini #heroFO, #ptable.mini .sheen { opacity: 0; transition: opacity .6s; }
#ptable.mini .cell { opacity: 1 !important; filter: none !important; }
#ptable.mini .cell .bg { fill-opacity: .85 !important; stroke: none !important; }
#ptable.mini .cell.selected .bg { fill: #000 !important; fill-opacity: 1 !important; stroke: #fff !important; stroke-width: 3 !important; }
#ptable .t-z, #ptable .t-sym, #ptable .t-name, #ptable .t-mass, #ptable .glabel, #ptable .legend, #ptable #heroFO { transition: opacity .9s .4s; }
.fly { position: fixed; z-index: 7; display: none; transform-origin: 0 0; pointer-events: none; filter: drop-shadow(0 0 18px rgba(139,92,246,.5)); }
.fly svg { display: block; width: 100%; height: 100%; } .fly .t-sym { fill: inherit; }

/* fullscreen */
.fs-btn { position: fixed; z-index: 20; bottom: .7rem; left: 50%; transform: translateX(-50%); display: inline-flex; gap: .45rem; align-items: center; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(8,10,28,.8); color: var(--text); font: 600 .72rem Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; backdrop-filter: blur(10px); }
.fs-btn:hover { border-color: var(--cyan); box-shadow: 0 0 14px rgba(34,211,238,.3); }

/* tablet / narrow */
@media (max-width: 1100px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; padding: .6rem .8rem 3.6rem; }
  .edge-left, .edge-right { display: none; }
  .edge-bottom { height: 6.5em; grid-template-columns: 1fr; }
  .site-nav { padding: 0 1rem; }
  .eg { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: auto minmax(0,1fr) minmax(0,.9fr) minmax(0,1fr);
    grid-template-areas: "cell orb mini" "ids orb props" "det chem map" "photo econ safety"; }
  .econ-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .eg { grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);
    grid-template-areas: "cell mini" "orb orb" "chem chem" "ids props" "det map" "photo safety" "econ econ"; }
  .metabar-viz { display: none; }
}
@media (prefers-reduced-motion: reduce) { .panel-e, .edge { transition-duration: .01s; } }
.cell text { pointer-events: none; }
.fly .t-sym, .ion-menu button { font-family: "Playfair Display", serif; }
main.page { max-width: none; margin: 0; padding: var(--nav-h) 0 0; height: 100vh; height: 100dvh; }
.stage { grid-template-columns: minmax(150px, 12vw) 1fr minmax(170px, 13vw); }
@media (max-width: 1100px) { main.page { padding-left: 0; padding-right: 0; } .stage { grid-template-columns: 1fr; } }

.credits { position: fixed; z-index: 19; right: .8rem; bottom: .25rem; max-width: calc(50% - 110px); font-size: .62rem; color: #64748b; text-align: right; line-height: 1.35; }
.credits a { color: #94a3b8; }
@media (max-width: 1100px) { .credits { left: .8rem; right: .8rem; max-width: none; text-align: center; bottom: .1rem; } .fs-btn { bottom: 1.6rem; } }
.srcblk { margin: .2rem 0 .4rem; } .srcblk > summary { cursor: pointer; color: var(--cyan); font-size: .72rem; letter-spacing: .05em; }
.srcblk p { margin: .2rem 0; } .more > summary { cursor: pointer; color: var(--muted); font-size: .7rem; }
.chart-t { font-size: .72rem; color: var(--gold-light); margin-bottom: .2rem; }
.signal { display: inline-block; font: 700 .8rem Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; padding: .1rem .6rem; border-radius: 4px; margin: .2rem 0; }
.sig-danger { background: #dc2626; color: #fff; } .sig-warning { background: #f59e0b; color: #111; }
.nfpa { float: right; width: 84px; text-align: center; margin: 0 0 .3rem .5rem; } .nfpa svg { width: 70px; height: 70px; }
.nfpa text { font: 700 16px Inter, sans-serif; text-anchor: middle; fill: #111; } .nfpa .sp { font-size: 10px; } .nfpa figcaption { font-size: .58rem; color: var(--muted); }
.markers circle { fill: var(--cyan); fill-opacity: .85; stroke: #fff; stroke-width: .6; }
.markers .pulse { fill: none; stroke: var(--cyan); animation: mkpulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mkpulse { from { transform: scale(1); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.markers text { font: 600 9px Inter, sans-serif; fill: #e2e8f0; text-anchor: middle; paint-order: stroke; stroke: #03040f; stroke-width: 2px; }

.orb-formula { position: absolute; left: .6rem; top: .4rem; right: 6.5rem; font-family: "Playfair Display", Georgia, serif; font-size: clamp(1rem, 1.6vw, 1.55rem); line-height: 1.3; pointer-events: none; text-shadow: 0 1px 6px rgba(3,4,15,.9); word-spacing: .15em; }
.orb-formula .ot { white-space: nowrap; transition: filter .3s, opacity .3s; }
.orb-formula .ot.off { filter: grayscale(1); opacity: .3; }
.orb-toggles { position: absolute; left: 50%; bottom: .5rem; transform: translateX(-50%); display: flex; gap: .55rem; }
.orb-toggles button { min-width: 44px; height: 44px; border-radius: 12px; font: 600 1.15rem "Playfair Display", Georgia, serif; color: #fff; background: color-mix(in srgb, var(--oc) 55%, transparent); border: 2px solid var(--oc); cursor: pointer; touch-action: manipulation; transition: filter .25s, opacity .25s, background .25s; box-shadow: 0 0 12px color-mix(in srgb, var(--oc) 45%, transparent); }
.orb-toggles button[aria-pressed="false"]:not(:disabled) { background: transparent; opacity: .6; box-shadow: none; }
.orb-toggles button:disabled { filter: grayscale(1); opacity: .28; cursor: not-allowed; box-shadow: none; }
.orb-toggles button:focus-visible { outline: 2px solid var(--gold, #fbbf24); outline-offset: 2px; }

.orb-bohr { position: absolute; right: .5rem; bottom: .5rem; width: clamp(96px, 22%, 170px); aspect-ratio: 1; pointer-events: none; background: radial-gradient(circle, rgba(3,4,15,.75) 55%, transparent 72%); border-radius: 50%; }
.orb-bohr[hidden] { display: none; }
.orb-bohr svg { width: 100%; height: 100%; display: block; overflow: visible; }
.orb-bohr .br { transition: opacity .3s, filter .3s; }
.orb-bohr .br.off { opacity: .2; filter: grayscale(1); }

/* return hint sits above the mini table; slot leaves room for it */
.slot-mini { margin-top: 1rem; }
.mode-element .mini-hint { opacity: 1; transition: opacity .6s ease .9s; }
/* narrow simulator: drop the long caption (formula + legend buttons carry the info) and keep Bohr clear of buttons */
@media (max-width: 1200px) { .orb-note { display: none; } .orb-bohr { width: clamp(80px, 26%, 130px); bottom: 3.4rem; } }
/* portrait / narrow: tall simulator, remaining panels scroll below */
@media (max-width: 820px) {
  .emode { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .eg { height: auto; grid-template-rows: auto minmax(46vh, auto) 320px 240px 240px 240px 280px; }
  .e-orb { min-height: 46vh; }
  .orb-bohr { width: 120px; bottom: 3.6rem; right: .4rem; }
}
@media (max-width: 820px) { .emode { padding-bottom: 6.5rem; } }

/* thin themed scrollbars, visible on hover only */
.emode .panel-e { position: relative; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.emode .panel-e:hover { scrollbar-color: rgba(139,92,246,.55) transparent; }
.emode .panel-e::-webkit-scrollbar { width: 6px; }
.emode .panel-e::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.emode .panel-e:hover::-webkit-scrollbar-thumb { background: rgba(139,92,246,.55); }
.scroll-hint { position: absolute; right: .6rem; z-index: 3; padding: .25rem .4rem; min-height: 24px; border: 0; border-radius: 6px; background: rgba(8,10,28,.85); color: var(--muted, #94a3b8); font: 600 .62rem/1 Inter, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; touch-action: manipulation; box-shadow: 0 -6px 12px rgba(8,10,28,.8); }
.scroll-hint:hover, .scroll-hint:focus-visible { color: var(--cyan, #22d3ee); outline: none; }
.scroll-hint[hidden] { display: none; }
.orb-toggles .orb-order { display: grid; place-items: center; }
/* legibility halo for symbols now that some type hues (blue/violet) are dark against the night background */
.t-sym { paint-order: stroke; stroke: rgba(226,232,240,.35); stroke-width: 1.2px; filter: drop-shadow(0 0 3px rgba(226,232,240,.25)); }

/* legend interaction */
.lg-item { cursor: pointer; }
.lg-item:hover text, .lg-item.active text { fill: var(--gold-light, #fbbf24); }
.lg-item.active rect { stroke: #fff; stroke-width: 2; }
#ptable .cell.lit { opacity: 1; filter: url(#glow); }
#ptable .cell.lit .bg { fill-opacity: .45; stroke-width: 3; stroke: #fff; }
#ptable .cell, #ptable .glabel, #ptable .plabel, #ptable .blabel, #ptable .ph { transition: opacity .5s ease; }
#ptable.legend-mode .cell:not(.ltype), #ptable.legend-mode .glabel, #ptable.legend-mode .plabel, #ptable.legend-mode .blabel { opacity: .1 !important; filter: none !important; }
#ptable.legend-mode .cell.ltype { opacity: 1; }
#ptable.legend-mode .cell.ltype.on .bg { stroke: #fff; }
#ptable.legend-mode .cell:not(.ltype) { pointer-events: none; }
.legend-info { font-family: Inter, sans-serif; color: var(--text); }
.legend-info h1 { font: 700 44px Cinzel, serif; margin: 0 0 8px; color: var(--gold); letter-spacing: .05em; text-shadow: 0 0 20px rgba(251,191,36,.3); }
.legend-info p { font-size: 22px; line-height: 1.45; margin: 0 0 6px; }
.legend-info .lsrc { font-size: 14px; color: var(--muted); } .legend-info .lsrc a { color: var(--cyan); }
#ptable:focus { outline: none; }

/* metabar hover echo */
.spark-wrap { position: relative; flex: 1; min-width: 120px; display: flex; }
.spark-wrap #spark { flex: 1; }
#sparkHi { position: absolute; inset: 0; pointer-events: none; }
#sparkHi .spl { position: absolute; top: 100%; margin-top: 1px; font: 600 10px/1 Inter, sans-serif; color: #fff; white-space: nowrap; text-shadow: 0 0 4px #03040f, 0 0 2px #03040f; }
#sparkHi .spl i { font-style: normal; color: var(--muted); font-weight: 400; }
#spark rect { transition: fill .15s; }
#spark rect.hi { fill: #fff; opacity: 1; stroke: #fff; stroke-width: 1; }
.scale .sw { position: relative; }
.scale .mk { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px #fff; }
.scale .mk b { position: absolute; bottom: 100%; left: 0; margin-bottom: 2px; font: 600 10px/1 Inter, sans-serif; color: #fff; white-space: nowrap; text-shadow: 0 0 4px #03040f; }

#spark { cursor: pointer; } #spark rect.hit { pointer-events: all; } #spark rect:not(.hit):not([data-k]) { pointer-events: none; }
#spark rect[data-k] { cursor: pointer; }

/* Chemistry panel */
.e-chem { grid-area: chem; }
.e-chem h3 { margin-bottom: .4rem; }
.chem-list { display: grid; gap: .6rem; }
.chem-card { display: grid; grid-template-columns: 92px 1fr; gap: .7rem; align-items: start; padding: .5rem; border: 1px solid var(--border); border-radius: 8px; background: rgba(13,16,48,.45); }
.chem-img { background: #fff; border-radius: 6px; padding: 4px; aspect-ratio: 1; display: grid; place-items: center; }
.chem-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.chem-body h4 { font: 600 .95rem "Playfair Display", serif; color: var(--text); margin: 0 0 .2rem; }
.chem-f { font: 500 .85rem Inter, sans-serif; color: var(--cyan); margin-left: .35rem; } .chem-f sub { font-size: .7em; }
.chem-body .cl { margin: .12rem 0; line-height: 1.4; } .chem-body .cl b { color: var(--muted); font-weight: 600; }
/* mini table: current element symbol + its column number */
#ptable .mini-sym { opacity: 0; font: 700 56px "Playfair Display", serif; fill: #fff; text-anchor: middle; pointer-events: none; transition: opacity .6s; }
#ptable.mini .mini-sym { opacity: 1; transition: opacity .6s .9s; }
#ptable.mini .glabel.cur { opacity: 1; fill: #fff; font-size: 64px; font-weight: 700; transition: opacity .6s .9s; }
/* ── guided tour ── */
.tour-dock { position: fixed; z-index: 30; display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; transition: left 1.5s cubic-bezier(.65,.05,.25,1), top 1.5s cubic-bezier(.65,.05,.25,1); }
.tour-btn { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: .45rem 1.2rem; border-radius: 999px; font: 500 1.05rem Inter, sans-serif; letter-spacing: .06em; cursor: pointer; touch-action: manipulation; transition: background .3s, border-color .3s, color .3s, box-shadow .3s; }
.tour-play { background: #14143a; border: 2px solid #6d5fd6; color: #c4b5fd; }
.tour-play:hover { box-shadow: 0 0 16px rgba(139,92,246,.5); }
.tour-play.is-stop { background: #2a0f1a; border-color: #e0607a; color: #fbc4cf; }
.tour-play.is-stop:hover { box-shadow: 0 0 16px rgba(244,63,94,.45); }
.tour-play .ti { display: inline-flex; }
.tour-restart { background: #0b1f26; border: 2px solid #2dd4bf; color: #99f6e4; font-size: .85rem; min-height: 38px; padding: .35rem 1rem; }
.tour-restart:hover { box-shadow: 0 0 14px rgba(45,212,191,.45); }
.tour-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.tour-spot { position: fixed; z-index: 25; pointer-events: none; border: 2px solid var(--gold); border-radius: 14px; box-shadow: 0 0 22px rgba(251,191,36,.55), inset 0 0 18px rgba(251,191,36,.18); transition: left .6s ease, top .6s ease, width .6s ease, height .6s ease, opacity .4s; animation: tourSpot 1.8s ease-in-out infinite; }
@keyframes tourSpot { 50% { box-shadow: 0 0 34px rgba(251,191,36,.8), inset 0 0 22px rgba(251,191,36,.25); } }
.tour-ptr { position: fixed; z-index: 40; pointer-events: none; width: 0; height: 0; transition: left .9s cubic-bezier(.45,.05,.3,1), top .9s cubic-bezier(.45,.05,.3,1); filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.tour-ptr svg { position: absolute; left: -4px; top: -2px; }
.tour-ripple { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--cyan); opacity: 0; }
.tour-ptr.clk .tour-ripple { animation: tourClk .6s ease-out; }
@keyframes tourClk { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
#ptable.tour-pulse { animation: tourPulse 2.4s ease-in-out 2; }
@keyframes tourPulse { 50% { filter: drop-shadow(0 0 18px rgba(139,92,246,.6)); transform: scale(1.012); } }
.hero-intro h1.tour-glow { animation: tourTitle 2s ease-in-out infinite; }
@keyframes tourTitle { 50% { text-shadow: 0 0 40px rgba(251,191,36,.9), 0 0 12px #fde68a; } }
.glabel.tour-lit, .plabel.tour-lit { fill: var(--gold) !important; filter: url(#glow); }
.blabel.tour-lit text { fill: var(--cyan); } .blabel.tour-lit path { stroke: var(--cyan); }
.legend.tour-glow text { fill: var(--gold-light); }
@media (max-width: 900px) { .tour-btn { font-size: .9rem; padding: .35rem .9rem; } .tour-dock { gap: .4rem; } }
.tour-btn[hidden] { display: none !important; }
#fly.tour-glow > svg { filter: drop-shadow(0 0 18px rgba(251,191,36,.75)); animation: tourTitle 2s ease-in-out infinite; }
#orbFormula .ot.tour-tpulse { display: inline-block; animation: tourTerm 1s ease-in-out infinite; text-shadow: 0 0 14px currentColor; }
@keyframes tourTerm { 50% { transform: scale(1.25); } }
.panel-e.tour-glow .map path.src { animation: tourMap 1s ease-in-out infinite; }
@keyframes tourMap { 50% { filter: drop-shadow(0 0 8px rgba(251,191,36,1)) brightness(1.4); } }
#slotMini.tour-glow { border-radius: 10px; box-shadow: 0 0 26px rgba(251,191,36,.6); }
#slotMini.tour-glow .mini-hint { opacity: 1; color: var(--gold-light); }
