/* ── Element detail glass modal (99.9% of the viewport on every screen) ── */

body.modal-open {
  overflow: hidden;
}

.element-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.element-modal-root[hidden] {
  display: none;
}

.element-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modal-fade-in 280ms ease;
}

.element-modal-glass {
  position: relative;
  width: 99.9vw;
  height: 99.9svh;
  max-width: 99.9vw;
  max-height: 99.9svh;
  display: flex;
  overflow: hidden;
  border-radius: clamp(12px, 1.2vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 12, 14, 0.72);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f0f0f0;
  animation: modal-scale-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.element-modal-accent {
  flex-shrink: 0;
  width: clamp(10px, 0.9vw, 16px);
  background: var(--modal-accent, #f9a825);
}

.element-modal-column {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.element-modal-inner {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(0.85rem, 1.6vw, 1.75rem);
  padding-top: clamp(0.75rem, 1.4vw, 1.25rem);
  overflow: hidden;
}

.element-modal-close {
  position: absolute;
  top: clamp(0.5rem, 1vw, 0.85rem);
  right: clamp(0.5rem, 1vw, 0.85rem);
  /* Above the header (z-index 8). That row has pointer-events on and
     used to sit over this button, so the X looked tappable but did nothing. */
  z-index: 30;
  pointer-events: auto;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #f0f0f0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.element-modal-close:hover,
.element-modal-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.06);
  outline: none;
}

/* ── Header ── */
.modal-header {
  --header-square: clamp(5.5rem, 12vw, 8.5rem);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  align-items: start;
  position: relative;
  z-index: 8;
  padding-bottom: clamp(0.65rem, 1vw, 1rem);
  border-bottom: 0;
  flex-shrink: 0;
  overflow: visible;
  /* Empty header space lets the shape through; the menu stays clickable. */
  pointer-events: none;
}

.modal-header :is(button, a, input, summary, label, .modal-header-main, .modal-deck-card, .modal-header-id) {
  pointer-events: auto;
}

.modal-header-id {
  container-type: inline-size;
  container-name: modal-tile;
  aspect-ratio: 1;
  width: var(--header-square);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin: 0;
  padding: 6% 4%;
  border: 0;
  background: var(--el-bg);
  color: #1a1a1a;
  font: inherit;
  border-radius: 0;
  cursor: pointer;
}

.modal-header-id[data-category="nonmetal"] {
  color: #ffffff;
}

.modal-atomic-number {
  font-size: clamp(0.55rem, 22cqw, 14rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  width: 100%;
}

.modal-id-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12em;
  min-height: 0;
  padding-bottom: 4%;
}

.modal-symbol {
  font-size: clamp(0.95rem, 46cqw, 28rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
}

.modal-atomic-mass {
  font-size: clamp(0.42rem, 16cqw, 1.05rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  opacity: 0.88;
  font-variant-numeric: tabular-nums;
}

.modal-header-id [data-tile-fact] {
  position: relative;
  z-index: 1;
  border-radius: 0.2em;
  cursor: help;
  transition:
    background 140ms ease,
    box-shadow 140ms ease;
}

.modal-header-id [data-tile-fact]:hover,
.modal-header-id [data-tile-fact]:focus-visible {
  background: rgba(0, 0, 0, 0.12);
  box-shadow: 0 0 0 0.12em rgba(0, 0, 0, 0.12);
  outline: none;
}

.tile-fact-tip {
  position: fixed;
  z-index: 1100;
  width: min(17.5rem, calc(100vw - 1.25rem));
  padding: 0.7rem 0.85rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      rgba(34, 36, 42, 0.98) 0%,
      rgba(14, 16, 20, 0.96) 100%
    );
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f2f2f2;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tile-fact-tip-kicker {
  margin: 0 0 0.28rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.tile-fact-tip-body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.modal-header-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  height: auto;
  min-height: var(--header-square);
  max-height: none;
  padding-right: 2.75rem;
  overflow: visible;
}

.modal-view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.modal-depth-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: 1px solid #64b5f6;
}

.modal-body-aspect {
  grid-template-columns: minmax(0, 1.4fr) minmax(11rem, 0.8fr);
}

.modal-body-aspect.modal-body-uses,
.modal-body-aspect.modal-body-life,
.modal-body-aspect.modal-body-safety,
.modal-body-aspect.modal-body-compare,
.modal-body-aspect.modal-body-lab,
.modal-body-aspect.modal-body-atom {
  grid-template-columns: 1fr;
}

/* Shapes may climb into the header gap. The menu row stays above them. */
.modal-body.modal-body-atom,
.modal-body.modal-body-atom .modal-main {
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 0;
}

.modal-aspect-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0.55rem 0 0.15rem;
}

.modal-back-atom {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(100, 181, 246, 0.55);
  border-radius: 999px;
  background: rgba(100, 181, 246, 0.12);
  color: #e3f2fd;
  font: inherit;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.modal-back-atom-arrow {
  font-size: 1.05em;
  line-height: 1;
}

.modal-back-atom:hover,
.modal-back-atom:focus-visible {
  outline: none;
  background: rgba(100, 181, 246, 0.22);
  border-color: #64b5f6;
  transform: translateX(-1px);
}

.modal-aspect-main {
  min-height: 0;
}

.modal-picture-cue {
  margin: 0 0 0.75rem;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
}

.modal-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
}

.modal-card {
  margin: 0 0 0.65rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.modal-card h4 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.modal-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

button.modal-card--life,
.modal-card--life,
button.modal-life-pick {
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.modal-card--life:hover,
.modal-card--life:focus-visible {
  border-color: rgba(129, 199, 132, 0.75);
  background: rgba(102, 187, 106, 0.14);
}

.modal-card--life.is-selected {
  border-color: #81c784;
  background: rgba(102, 187, 106, 0.18);
  box-shadow: 0 0 0 1px rgba(129, 199, 132, 0.4);
}

button.modal-human-value.modal-life-pick {
  border: 1px solid transparent;
  background: transparent;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
}

button.modal-human-value.modal-life-pick:hover,
button.modal-human-value.modal-life-pick:focus-visible {
  border-color: rgba(129, 199, 132, 0.55);
  background: rgba(102, 187, 106, 0.1);
}

button.modal-human-value.modal-life-pick.is-selected {
  border-color: rgba(129, 199, 132, 0.7);
  background: rgba(102, 187, 106, 0.12);
}

.modal-dyk {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.modal-dyk p,
.modal-dyk-list {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.modal-dyk-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.modal-dyk-item.is-nobel,
.atom-deck-dyk li.is-nobel {
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 213, 79, 0.28);
  background: rgba(255, 213, 79, 0.08);
}

.atom-deck-dyk {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.atom-deck-dyk h4 {
  margin: 0 0 0.4rem;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: #ffe082;
}

.atom-deck-dyk ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.atom-deck-dyk li {
  margin: 0;
  font-size: inherit;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.86);
}

.modal-glosses {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal-gloss {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  background: rgba(255, 255, 255, 0.04);
}

.modal-gloss summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  list-style: none;
}

.modal-gloss summary::-webkit-details-marker {
  display: none;
}

.modal-gloss-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.7rem;
  font-style: italic;
}

.modal-gloss p {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
}

.modal-gloss-trivia {
  color: rgba(255, 255, 255, 0.55) !important;
}

.modal-lab-stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 20%, rgba(156, 204, 101, 0.12), transparent 50%),
    rgba(255, 255, 255, 0.03);
}

.modal-lab-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.modal-question-list {
  margin-top: 0.85rem;
}

.modal-atom-stage .atom-diagram {
  height: 100%;
}

.atom-hub {
  display: grid;
  height: 100%;
  min-height: 0;
  width: 100%;
  gap: clamp(0.55rem, 1.4vw, 1rem);
  grid-template-columns: minmax(12rem, 35%) minmax(0, 65%);
  align-items: stretch;
}

.atom-hub-atom {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.atom-hub-atom-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Author display:flex must not override the hidden attribute */
.atom-hub-atom-main[hidden] {
  display: none !important;
}

.atom-hub-atom-main .atom-diagram {
  flex: 1 1 auto;
  min-height: 0;
}

.atom-hub-note {
  flex-shrink: 0;
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.58);
}

.atom-deck {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

/* Lucide icon tray — always one row; scroll sideways if the header is tight */
.atom-deck-stack {
  --deck-icon-size: var(--name-line, 2.2rem);
  --dock-max: 1.65;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.12rem 0.18rem;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}

.atom-deck-stack::-webkit-scrollbar {
  display: none;
}

/* Room for scale + neighbour slide; transforms must not reflow the header */
.atom-deck-stack--dock {
  --dock-max: 1.55;
  padding-block: calc((var(--dock-max) - 1) * var(--deck-icon-size) / 2);
  padding-inline: calc((var(--dock-max) - 1) * var(--deck-icon-size) * 1.1);
  box-sizing: content-box;
  overflow: visible;
}

.atom-hub-visual {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.atom-hub-visual[hidden] {
  display: none !important;
}

/* Structure / Isotopes: right stage matches card + drag-instructions height */
.atom-hub.has-hub-visual {
  grid-template-columns: minmax(10.5rem, 28%) minmax(0, 72%);
  align-items: start;
}

.atom-hub.has-hub-visual .atom-deck {
  justify-content: flex-start;
  height: auto;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.atom-hub.has-hub-visual .atom-hub-atom {
  align-self: start;
  width: 100%;
  /* Height synced in JS to [data-deck-drawn] (card + meta) */
  min-height: 0;
  transition: height 0.32s cubic-bezier(0.22, 0.82, 0.24, 1);
}

/* Desktop: tab + scrim unused */
.atom-hub-info-tab,
.atom-hub-info-scrim {
  display: none;
}

/* No size tween while WebGL boots — avoids resize flicker on first paint */
.atom-hub.has-hub-visual.is-structure-booting .atom-hub-atom,
.hub-structure-viewport.is-structure-booting {
  transition: none !important;
}

.atom-hub.has-hub-visual .atom-hub-visual {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  justify-content: center;
}

.atom-hub.has-hub-visual .hub-structure-stage,
.atom-hub.has-hub-visual .hub-life-stage {
  justify-content: stretch;
  align-items: stretch;
  padding-top: 0;
  height: 100%;
  width: 100%;
}

/* 3D structure viewports — use the full right panel (not a centred square) */
.atom-hub.has-hub-visual .hub-structure-viewport {
  --structure-box: 100%;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  flex: 1 1 auto;
  align-self: stretch;
}

/*
 * Bonds compound molecule — fill the visible right panel; molecule canvas
 * uses the full stage.
 */
.atom-hub.has-hub-visual.has-bond-molecule {
  align-items: stretch;
}

.atom-hub.has-hub-visual.has-bond-molecule .atom-hub-atom {
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

.atom-hub.has-hub-visual.has-bond-molecule .atom-hub-visual {
  justify-content: stretch;
  align-items: stretch;
}

.atom-hub.has-hub-visual.has-bond-molecule .atom-hub-visual,
.atom-hub.has-hub-visual .hub-structure-stage.is-bond-molecule {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-height: 0;
  padding: 0;
  gap: 0;
}

.hub-bond-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: visible;
  box-sizing: border-box;
}

.atom-hub.has-hub-visual .hub-structure-stage.is-bond-molecule .hub-structure-viewport {
  position: absolute;
  inset: 0;
  left: 0;
  top: 0;
  transform: none;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  max-width: none;
  max-height: none;
  align-self: stretch;
  border-radius: 0;
  z-index: 1;
}

/* Bond-angle switch stays off the compound stage — the molecule is the view. */
.hub-bond-visual .hub-structure-angle-switch,
.atom-hub.has-bond-molecule .hub-structure-angle-switch {
  display: none;
}

.hub-bond-molecule-name {
  position: absolute;
  top: 0.75rem;
  left: 0.95rem;
  right: auto;
  bottom: auto;
  z-index: 5;
  flex: 0 0 auto;
  max-width: min(36rem, max(9rem, calc(50% - 4.5rem)));
  margin: 0;
  padding: 0;
  text-align: left;
  background: none;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.hub-bond-molecule-name[hidden] {
  display: none;
}

.hub-bond-molecule-name .acronym,
.hub-bond-molecule-name .acronym-info {
  pointer-events: auto;
}

.hub-bond-molecule-name strong {
  font-weight: 700;
  color: #e0f7f4;
}

.hub-bond-molecule-name-sep {
  margin: 0 0.35em;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
}

.hub-bond-molecule-name:has(+ .hub-bond-shape-desc:not(:empty)) {
  padding-bottom: 0.15rem;
}

.hub-bond-shape-desc {
  position: absolute;
  left: 0.95rem;
  right: 1.25rem;
  top: 50%;
  bottom: auto;
  z-index: 4;
  flex: 0 0 auto;
  max-width: 36rem;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  text-align: left;
  background: none;
  font-size: clamp(0.9rem, 1.45vw, 1.05rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.hub-bond-shape-desc[hidden] {
  display: none;
}

.hub-bond-shape-desc:empty {
  display: none;
  padding: 0;
}

.hub-bond-shape-desc .acronym,
.hub-bond-shape-desc .acronym-info {
  pointer-events: auto;
}

.hub-bond-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem 1.15rem;
  margin: 0;
  padding: 0.15rem 1rem 0.85rem;
  list-style: none;
}

.hub-bond-legend[hidden] {
  display: none;
}

.hub-bond-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.78rem, 1.2vw, 0.9rem);
  line-height: 1.2;
}

.hub-bond-legend-mark {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 3px;
  border-radius: 999px;
  background: #fff;
}

.hub-bond-legend-mark.is-double {
  height: 9px;
  background:
    linear-gradient(#fff, #fff) top / 100% 3px no-repeat,
    linear-gradient(#fff, #fff) bottom / 100% 3px no-repeat;
}

.hub-bond-legend-mark.is-triple {
  height: 13px;
  background:
    linear-gradient(#fff, #fff) top / 100% 3px no-repeat,
    linear-gradient(#fff, #fff) center / 100% 3px no-repeat,
    linear-gradient(#fff, #fff) bottom / 100% 3px no-repeat;
}

.hub-bond-legend-mark.is-ionic {
  height: 3px;
  border-radius: 0;
  background: repeating-linear-gradient(
    90deg,
    #ffd54f 0 6px,
    transparent 6px 11px
  );
}

.hub-bond-legend-mark.is-lone,
.hub-bond-legend-mark.is-sea {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #fff;
}

.hub-bond-legend-mark.is-sea {
  background: #4db6ac;
}

.atom-hub.has-bond-molecule .hub-bond-type-tabs {
  top: 2.15rem;
}

.hub-bond-type-tabs {
  position: absolute;
  top: 0.65rem;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  z-index: 50;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem;
  pointer-events: auto;
  background: rgba(10, 16, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hub-bond-type-tabs-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
  pointer-events: auto;
}

.hub-bond-type-tab {
  position: relative;
  z-index: 51;
  margin: 0;
  padding: 0.32rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.72rem, 1.2vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.hub-bond-type-tab:hover,
.hub-bond-type-tab:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

.hub-compound-blackboard {
  color: #e8eef8;
}

.hub-compound-blackboard:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Entry is the compounds Blackboard tab. The viewport control is Exit once fullscreen. */
.hub-bond-visual .hub-structure-viewport.is-structure-ready > .hub-structure-fs-btn {
  opacity: 0;
  pointer-events: none;
}

.hub-bond-visual .hub-structure-viewport.is-structure-fullscreen > .hub-structure-fs-btn,
.hub-bond-visual .hub-structure-viewport:fullscreen > .hub-structure-fs-btn,
.hub-bond-visual .hub-structure-viewport:-webkit-full-screen > .hub-structure-fs-btn {
  opacity: 1;
  pointer-events: auto;
}

.hub-compound-board-title {
  position: absolute;
  top: 0.85rem;
  left: 0.95rem;
  z-index: 12;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  max-width: min(42rem, calc(100% - 11rem));
  margin: 0;
  color: #fff;
  font-size: clamp(1.2rem, 2.4vw, 1.85rem);
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: left;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.hub-compound-board-title[hidden] {
  display: none;
}

.hub-compound-board-title strong {
  font-weight: 700;
  color: #e0f7f4;
}

.hub-compound-board-title-sep {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

.hub-bond-visual .hub-structure-viewport.is-presenter-board > .hub-structure-fs-btn,
.hub-structure-viewport.is-compound-board-shell > .hub-structure-fs-btn {
  left: auto;
  right: 6.4rem;
}

.hub-structure-viewport.is-compound-board-shell {
  position: fixed;
  inset: 0;
  z-index: 240;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 50% 40%, #121826 0%, #070a12 70%);
  overflow: hidden;
}

/* After Esc, leftover board chrome must not sit on the in-card molecule. */
.hub-bond-visual .hub-structure-viewport:not(:fullscreen):not(.is-compound-board-shell) > [data-board-brand],
.hub-bond-visual .hub-structure-viewport:not(:fullscreen):not(.is-compound-board-shell) > [data-pencil-dock],
.hub-bond-visual .hub-structure-viewport:not(:fullscreen):not(.is-compound-board-shell) > [data-compound-board-title],
.hub-bond-visual .hub-structure-viewport:not(:fullscreen):not(.is-compound-board-shell) > .hub-structure-fs-btn {
  display: none !important;
}

.hub-structure-meta .hub-bond-type-tabs.is-meta-tabs {
  position: static;
  transform: none;
  left: auto;
  top: auto;
  margin: 0 0 0.15rem;
  align-self: flex-start;
}

.hub-structure-viewport.is-bond-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      ellipse at 50% 42%,
      rgba(255, 255, 255, 0.07),
      transparent 64%
    );
}

.hub-bond-formula-2d {
  width: min(100%, 36rem);
  height: min(100%, 78%);
  max-height: 28rem;
  overflow: visible;
}

.hub-bond-formula-note {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  fill: #ffffff;
  paint-order: stroke fill;
  stroke: rgba(10, 16, 26, 0.88);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.hub-bond-formula-lone-dot {
  fill: #ffffff;
  stroke: rgba(10, 16, 26, 0.55);
  stroke-width: 1.2px;
}

.hub-bond-formula-lone-dot[data-electron-kind="sea"] {
  fill: #4db6ac;
}

/* World — fill the right column; Earth spins as a large background */
.atom-hub.has-world-globe {
  align-items: stretch;
}

.atom-hub.has-world-globe .atom-hub-atom {
  height: 100%;
  min-height: min(78vh, 100%);
  align-self: stretch;
}

.atom-hub.has-world-globe .atom-hub-visual,
.atom-hub.has-world-globe .hub-world-stage {
  height: 100%;
  min-height: 0;
  justify-content: stretch;
  align-items: stretch;
}

/* Lab must stretch so the empty bench (absolute-only children) keeps height */
.atom-hub.has-hub-visual .hub-lab-stage {
  justify-content: stretch;
  align-items: stretch;
  padding-top: 0;
  height: 100%;
  width: 100%;
}

/* Lab fullscreen workspace fills the visual column */
.atom-hub.has-lab-stage {
  align-items: stretch;
}

.atom-hub.has-lab-stage .atom-hub-atom {
  height: 100%;
  min-height: min(72vh, 100%);
  align-self: stretch;
}

.atom-hub.has-lab-stage .atom-hub-visual,
.atom-hub.has-lab-stage .hub-lab-stage,
.atom-hub.has-lab-stage .hub-lab-bench {
  height: 100%;
  min-height: 0;
}

.atom-hub.has-hub-visual.is-drawer-layout .hub-lab-stage {
  height: 100%;
}

.atom-hub.has-hub-visual .atom-deck-drawn {
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  gap: 0;
}

.atom-hub.has-hub-visual .atom-deck-drawn-card {
  height: auto;
  max-height: none;
  flex: 0 1 auto;
}

.hub-structure-stage,
.hub-isotope-strip {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.25rem;
  overflow: hidden;
  container-type: size;
}

.hub-structure-stage {
  position: relative;
  overflow: hidden;
  justify-content: center;
  width: 100%;
}

/* Uses — pictures and science-store cards replace the Bohr atom */
.atom-hub.has-uses-gallery {
  align-items: stretch;
}

.atom-hub.has-uses-gallery .atom-hub-atom {
  align-self: stretch;
  height: 100%;
  min-height: 0;
}

.atom-hub.has-uses-gallery .atom-hub-visual {
  overflow: hidden;
  height: 100%;
  min-height: 0;
  justify-content: stretch;
  align-items: stretch;
  background: #080a0e;
}

.hub-uses-gallery {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.35rem 0.2rem 0.2rem;
  overflow: hidden;
  container-type: size;
  container-name: uses-gallery;
}

.hub-uses-empty {
  margin: auto;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.hub-uses-brief[hidden],
.hub-uses-news[hidden] {
  display: none !important;
}

.hub-uses-hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 8.5rem;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--uses-accent, #a1887f) 35%, transparent), transparent 55%),
    rgba(255, 255, 255, 0.05);
}

.hub-uses-hero[hidden] {
  display: none !important;
}

.hub-uses-hero img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub-uses-hero.has-photo img {
  display: block;
}

.hub-uses-hero-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--uses-accent, #a1887f);
}

.hub-uses-hero.has-photo .hub-uses-hero-fallback {
  display: none;
}

.hub-uses-hero-fallback .atom-deck-icon {
  width: 4.4rem;
  height: 4.4rem;
}

.hub-uses-hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.45rem 0.65rem;
  font-size: clamp(0.68rem, 1.1vw, 0.8rem);
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}

.hub-uses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr));
  justify-content: start;
  align-content: start;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.05rem;
  scrollbar-width: thin;
}

@container uses-gallery (min-width: 24rem) {
  .hub-uses-grid {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 14.5rem));
    gap: 0.6rem;
  }
}

@container uses-gallery (min-width: 40rem) {
  .hub-uses-grid {
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 16rem));
    gap: 0.7rem;
  }
}

.hub-uses-gallery.has-selection .hub-uses-grid {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.hub-uses-card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 100%;
  max-width: 16rem;
  margin: 0;
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hub-uses-gallery.has-selection .hub-uses-card {
  flex: 0 0 5.5rem;
  max-width: 5.5rem;
}

.hub-uses-card:hover,
.hub-uses-card:focus-visible {
  border-color: color-mix(in srgb, var(--uses-accent, #a1887f) 70%, #fff);
  background: rgba(255, 255, 255, 0.09);
}

.hub-uses-card.is-selected {
  border-color: var(--uses-accent, #a1887f);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--uses-accent, #a1887f) 55%, transparent);
}

.hub-uses-card-photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  color: var(--uses-accent, #a1887f);
}

.hub-uses-card-photo .atom-deck-icon {
  width: 1.7rem;
  height: 1.7rem;
}

.hub-uses-card-photo img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub-uses-card-photo.has-photo img {
  display: block;
}

.hub-uses-card-photo.has-photo .atom-deck-icon {
  display: none;
}

.hub-uses-card-name {
  font-size: clamp(0.68rem, 1.05vw, 0.78rem);
  font-weight: 650;
  line-height: 1.25;
}

.hub-uses-card-kind {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: rgba(255, 255, 255, 0.52);
}

/* Medicine + news — one row card, same treatment as the compounds list */
.hub-uses-brief {
  margin: 0.7rem 0 0;
}

.hub-uses-brief-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hub-uses-brief-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem 0.6rem;
}

.hub-uses-brief-block + .hub-uses-brief-block {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-uses-brief-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 700;
  line-height: 1.2;
  color: #e3f2fd;
}

.hub-uses-brief-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--brief-icon, #f48fb1);
}

.hub-uses-brief-icon--medicine {
  --brief-icon: #f48fb1;
}

.hub-uses-brief-icon--news {
  --brief-icon: #81c784;
}

.hub-uses-brief-icon svg,
.hub-uses-brief-icon .atom-deck-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  color: inherit;
  stroke: currentColor;
}

.hub-uses-brief-text {
  margin: 0;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}

.hub-uses-brief ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hub-uses-brief a {
  color: #e3f2fd;
  font-weight: 650;
  text-decoration: none;
}

.hub-uses-brief a:hover,
.hub-uses-brief a:focus-visible {
  text-decoration: underline;
}

.hub-uses-brief time {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.78em;
  color: rgba(255, 255, 255, 0.5);
}

.hub-uses-foot {
  flex: 0 0 auto;
  margin: 0;
  font-size: clamp(0.62rem, 0.95vw, 0.72rem);
  color: rgba(255, 255, 255, 0.48);
}

.modal-uses-list li:has(.hub-uses-chip) {
  padding: 0;
}

.hub-uses-chip {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.22rem 0.55rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: inherit;
  border-radius: inherit;
}

.hub-uses-chip:hover,
.hub-uses-chip:focus-visible {
  text-decoration: underline;
}

/* Lab — flat dark stage (no light centre wash) */
.hub-lab-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  border-radius: 16px;
  background: #070a12;
  /* Never inherit a parent filter/blur onto the experiment UI */
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* True browser fullscreen for Lab (teaching / TV) */
.hub-lab-stage:fullscreen,
.hub-lab-stage:-webkit-full-screen,
.hub-lab-stage.is-lab-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 4000;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  background: #070a12;
  filter: none !important;
}

.hub-lab-fs-exit {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 18, 30, 0.72);
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: clamp(0.68rem, 1.1vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hub-lab-fs-exit:hover,
.hub-lab-fs-exit:focus-visible {
  background: rgba(20, 28, 44, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
  outline: none;
}

.hub-lab-fs-exit:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

.hub-lab-fs-exit[hidden] {
  display: none;
}

.hub-lab-bench {
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
}

.hub-lab-stage-surface {
  display: none;
}

/* —— Lab command palette (engine API) —— */
.atom-hub.has-lab-stage .atom-deck-drawn {
  display: none;
}

.lab-left {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(12rem, 1fr) auto;
  gap: 0.65rem;
  overflow: hidden;
}

.lab-command-panel,
.lab-result-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 16, 28, 0.88);
}

.lab-command-panel {
  padding: 0.7rem 0.8rem 0.8rem;
  gap: 0.35rem;
}

.lab-command-guide {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(0.72rem, 1.05vw, 0.82rem);
  line-height: 1.4;
}

.lab-clear-btn {
  margin: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lab-clear-btn:hover,
.lab-clear-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
}

.lab-command-title {
  margin: 0;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lab-command-hint,
.lab-command-keys,
.lab-command-status {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.72rem, 1.1vw, 0.82rem);
  line-height: 1.4;
}

.lab-command-label {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.lab-command-input {
  width: 100%;
  resize: vertical;
  min-height: 4.4rem;
  margin: 0;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 10, 20, 0.9);
  color: #f4f7fb;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
}

.lab-command-input:focus {
  outline: 2px solid rgba(120, 180, 255, 0.7);
  outline-offset: 1px;
}

.lab-command-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.lab-plus-btn {
  margin: 0;
  min-width: 2.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.lab-plus-btn:hover,
.lab-plus-btn:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.lab-run-btn {
  margin: 0;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(38, 198, 218, 0.18);
  color: #e8fbff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lab-run-btn:hover,
.lab-run-btn:focus-visible {
  background: rgba(38, 198, 218, 0.3);
  outline: none;
}

.lab-run-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.lab-command-status[data-tone='error'] {
  color: #ffb4b4;
}

.lab-command-status[data-tone='ok'] {
  color: #b7f0c6;
}

.lab-cmd-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  overflow: auto;
}

.lab-cmd-chip {
  margin: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.lab-cmd-chip:hover,
.lab-cmd-chip:focus-visible {
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
}

.lab-result-panel {
  padding: 0.95rem 1rem 1rem;
  overflow: auto;
}

.lab-result-idle-title,
.lab-result-card h4 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.lab-result-idle-copy,
.lab-result-lede {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
  max-width: 42rem;
}

.lab-result-equation {
  margin: 0.2rem 0 0.65rem;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.lab-result-equation sub {
  font-size: 0.62em;
}

.lab-result-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.lab-result-facts {
  display: grid;
  gap: 0.45rem 1rem;
  margin: 1rem 0 0;
}

.lab-result-fact {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
}

.lab-result-fact dt {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
}

.lab-result-fact dd {
  margin: 0;
  font-weight: 600;
}

.lab-result-notes {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.lab-result-card.is-error h4,
.lab-result-card.is-unsupported h4 {
  color: #ffd7a8;
}

.lab-result-raw {
  margin-top: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

.lab-result-raw pre {
  margin: 0.5rem 0 0;
  padding: 0.7rem;
  overflow: auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.75rem;
}

/* —— Lab ionic workspace (periodic table + 3D) —— */
.lab-workspace [hidden] {
  display: none !important;
}

.lab-workspace {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.75rem 0.85rem 0.85rem;
  color: #f4f7fb;
  pointer-events: auto;
  filter: none !important;
}

/* Two equal halves: table + commands | output. Must follow .lab-workspace
   so display:grid wins over the ionic flex column. */
.lab-workspace.lab-command-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  height: 100%;
  min-height: 0;
  padding: 3rem 0.85rem 0.85rem 4.6rem;
  overflow: hidden;
}

.lab-workspace.lab-command-workspace .lab-left,
.lab-workspace.lab-command-workspace .lab-result-panel {
  height: 100%;
  min-height: 0;
}

.lab-workspace.lab-command-workspace .lab-table-panel {
  height: auto;
  min-height: 0;
}

.lab-workspace.lab-command-workspace .lab-mini-table-wrap {
  min-height: 10rem;
}

.lab-workspace.lab-command-workspace .lab-mini-table {
  width: min(100%, calc(100cqh * 18 / 7));
  max-height: 100%;
}

@media (max-width: 720px) {
  .lab-workspace.lab-command-workspace {
    padding: 3.1rem 0.55rem 0.55rem 3.4rem;
    gap: 0.5rem;
  }

  .lab-command-input {
    min-height: 3.6rem;
  }
}

.lab-workspace-header {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.4rem;
}

.lab-ionic-workspace .lab-mode-blurb {
  flex: 1 1 100%;
  font-size: clamp(0.72rem, 1.1vw, 0.84rem);
}

.lab-mode-blurb {
  margin: 0;
  flex: 1 1 12rem;
  font-size: clamp(0.78rem, 1.2vw, 0.9rem);
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

.lab-mode-blurb strong {
  color: #fff;
  font-weight: 700;
}

.lab-pick-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.lab-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 14, 28, 0.72);
  font-size: clamp(0.78rem, 1.2vw, 0.9rem);
  font-weight: 700;
  color: #fff;
}

.lab-chip small {
  font-weight: 500;
  opacity: 0.72;
}

.lab-chip.is-slot {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  border-style: dashed;
}

.lab-chip.is-dim {
  opacity: 0.45;
}

.lab-chip.is-formula {
  background: rgba(66, 165, 245, 0.22);
  border-color: rgba(100, 181, 246, 0.55);
  color: #e3f2fd;
}

.lab-chip.is-bond {
  font-size: clamp(0.68rem, 1vw, 0.78rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.lab-chip.is-bond.is-ionic {
  background: rgba(255, 183, 77, 0.2);
  border-color: rgba(255, 183, 77, 0.55);
  color: #ffe0b2;
}

.lab-chip.is-bond.is-covalent {
  background: rgba(129, 199, 132, 0.2);
  border-color: rgba(129, 199, 132, 0.55);
  color: #c8e6c9;
}

.lab-chip-arrow {
  opacity: 0.45;
  font-weight: 700;
}

.lab-reset-btn {
  margin: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 18, 30, 0.65);
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: clamp(0.72rem, 1.1vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.lab-reset-btn:hover,
.lab-reset-btn:focus-visible {
  background: rgba(30, 40, 60, 0.85);
  outline: none;
}

/* Fullscreen Lab — 50% table | 50% 3D */
.lab-ionic-workspace.lab-workspace {
  padding: 0.65rem 0.75rem 0.75rem;
}

.lab-ionic-body.lab-workspace-body,
.lab-workspace-body.lab-ionic-body {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

@media (max-width: 820px) {
  .lab-ionic-body.lab-workspace-body,
  .lab-workspace-body.lab-ionic-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(12rem, 40%) minmax(0, 1fr);
  }
}

.lab-table-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  container-type: size;
}

.lab-table-heading {
  flex: 0 0 auto;
}

.lab-mini-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}

.lab-card-slot {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}

.lab-card-slot:empty {
  display: none;
}

/* Lab teaching card under the table (clone of the deck card) */
.lab-card-under-table {
  position: relative;
  width: 100%;
  margin: 0;
  max-height: min(48vh, 24rem);
  overflow: auto;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lab-card-under-table .atom-deck-drawn-copy {
  font-size: clamp(0.82rem, 1.35cqw, 0.98rem);
}

.lab-card-under-table .hub-panel-copy {
  margin: 0 0 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.lab-card-under-table .hub-panel-copy .hub-geometry-title {
  margin-top: 0.45rem;
}

.lab-examples-block {
  margin-top: 0.15rem;
}

.lab-examples-title {
  margin: 0 0 0.35rem;
  font-size: clamp(0.82rem, 1.3cqw, 0.95rem);
  font-weight: 750;
  color: #ffe082;
}

.lab-card-under-table .atom-deck-dyk {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
}

.lab-card-under-table .atom-deck-dyk:first-of-type {
  margin-top: 0.4rem;
}

.lab-card-under-table .atom-deck-dyk h4 {
  font-size: clamp(0.82rem, 1.3cqw, 0.95rem);
}

.lab-card-under-table .atom-deck-dyk li.is-nobel {
  padding: 0;
}

.lab-example-btn {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}

.lab-example-btn:hover,
.lab-example-btn:focus-visible {
  background: rgba(255, 213, 79, 0.12);
  outline: none;
}

.lab-example-formula {
  font-weight: 750;
  color: #ffe082;
  letter-spacing: 0.02em;
}

.lab-example-formula sub {
  font-size: 0.68em;
  font-weight: 700;
}

.lab-example-name {
  color: rgba(255, 255, 255, 0.82);
}

.lab-card-under-table .atom-deck-dyk li.is-nobel.is-active {
  border-color: rgba(255, 213, 79, 0.72);
  background: rgba(255, 213, 79, 0.18);
}

.lab-table-title {
  margin: 0;
  font-size: clamp(1.1rem, 2.2cqw, 1.55rem);
  font-weight: 750;
  color: #fff;
}

.lab-table-hint {
  margin: 0.2rem 0 0;
  font-size: clamp(0.8rem, 1.5cqw, 1rem);
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.35;
}

.lab-stage-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.55rem 0.65rem;
}

.lab-stage-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
}

.lab-ionic-workspace .lab-mode-blurb {
  flex: 1 1 12rem;
  font-size: clamp(0.72rem, 1.1vw, 0.84rem);
}

.lab-stage-canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 12rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(40, 60, 90, 0.35), transparent 65%),
    #05080f;
}

.lab-formula-banner {
  position: absolute;
  top: 0.55rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 6;
  text-align: center;
  pointer-events: none;
}

.lab-formula-banner-formula {
  margin: 0;
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}

.lab-formula-banner-formula sub {
  font-size: 0.58em;
  font-weight: 700;
}

.lab-formula-banner-name {
  margin: 0.2rem 0 0;
  font-size: clamp(0.82rem, 1.35vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}

.lab-stage-idle {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  padding: 1.25rem;
  text-align: center;
  pointer-events: none;
}

.lab-stage-idle-title {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 750;
  color: #fff;
}

.lab-stage-idle-copy {
  margin: 0;
  max-width: 22rem;
  font-size: clamp(0.8rem, 1.3vw, 0.95rem);
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

.lab-structure-viewport.hub-structure-viewport,
.lab-ionic-viewport {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  --structure-box: 100%;
  border-radius: 12px;
}

.lab-ionic-viewport {
  overflow: hidden;
}

.lab-ionic-viewport.is-ionic-booting .lab-ionic-canvas {
  opacity: 0;
}

.lab-ionic-viewport.is-ionic-ready .lab-ionic-canvas {
  opacity: 1;
  transition: opacity 220ms ease;
}

.lab-ionic-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.lab-structure-caption {
  margin: 0;
  padding: 0.15rem 0.35rem 0.25rem;
  font-size: clamp(0.78rem, 1.2vw, 0.9rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

.lab-ionic-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  padding: 0.25rem 0.35rem 0.15rem;
}

.lab-ionic-key-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.lab-ionic-key-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  gap: 0.85rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.88);
}

.lab-ionic-key-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lab-key-swatch {
  --sw: #9ea5ae;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: var(--sw);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Same 18×7 board geometry — fill the wrap above the Lab card */
.lab-mini-table {
  --lab-gap: clamp(2px, 0.4vw, 6px);
  /* Prefer full wrap width; shrink if height is tight (card below) */
  width: min(100cqw, calc(100cqh * 18 / 7));
  height: auto;
  aspect-ratio: 18 / 7;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: var(--lab-gap);
}

.lab-el-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.05rem 0.02rem;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  background: var(--el-bg, #78909c);
  color: #0d1118;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease,
    opacity 120ms ease;
}

.lab-el-btn[data-category="nonmetal"] {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

.lab-el-btn:hover,
.lab-el-btn:focus-visible {
  z-index: 2;
  transform: scale(1.16);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
  outline: none;
}

.lab-el-num {
  display: block;
  font-size: clamp(0.55rem, 2.4cqw, 1rem);
  font-weight: 650;
  opacity: 0.75;
  line-height: 1;
}

.lab-el-sym {
  font-size: clamp(0.85rem, 4.4cqw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.lab-el-btn.is-in-lab:not(.is-muted) {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.lab-el-btn.is-partner {
  box-shadow:
    0 0 0 2px #ffd54f,
    0 0 12px rgba(255, 213, 79, 0.45);
  animation: lab-partner-pulse 1.1s ease-in-out infinite;
}

.lab-el-btn.is-selected {
  box-shadow:
    0 0 0 2px #fff,
    0 0 14px rgba(100, 181, 246, 0.55);
  z-index: 3;
}

.lab-el-btn.is-muted {
  opacity: 0.28;
  filter: grayscale(0.35);
}

@keyframes lab-partner-pulse {
  50% {
    box-shadow:
      0 0 0 2px #ffe082,
      0 0 18px rgba(255, 213, 79, 0.65);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab-el-btn.is-partner {
    animation: none;
  }
}

.hub-isotope-interest {
  width: min(100%, 36rem);
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.hub-isotope-interest h4 {
  margin: 0 0 0.4rem;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: #f8bbd0;
}

.hub-isotope-interest .hub-isotope-notes {
  margin: 0;
}

.hub-structure-svg {
  width: min(100%, 22rem);
  height: auto;
  max-height: min(48vh, 20rem);
}

.hub-structure-viewport {
  position: relative;
  /*
   * Fluid square: tracks the stage (card-matched) and the browser viewport.
   * cqw/cqh follow the stage; vmin keeps phone / short windows honest.
   */
  --structure-box: min(100cqw, 100cqh, 72vmin, 40rem);
  width: var(--structure-box);
  height: var(--structure-box);
  max-width: 100%;
  max-height: 100%;
  flex: 0 0 auto;
  border-radius: 16px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: transparent;
  box-shadow: none;
  z-index: 1;
  transition:
    width 0.32s cubic-bezier(0.22, 0.82, 0.24, 1),
    height 0.32s cubic-bezier(0.22, 0.82, 0.24, 1);
}

@media (prefers-reduced-motion: reduce) {
  .hub-structure-viewport,
  .atom-hub.has-hub-visual .atom-hub-atom {
    transition: none;
  }
}

/* Sits under the left teaching card */
.hub-structure-meta {
  position: static;
  width: 100%;
  margin: 0.55rem 0 0;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  pointer-events: auto;
}

.hub-structure-meta .acronym-info {
  pointer-events: auto;
}

.atom-deck-drawn > .hub-structure-meta {
  flex-shrink: 0;
}

@supports not (width: 1cqw) {
  .hub-structure-viewport {
    --structure-box: min(100%, 72vmin, 40rem);
  }
}

.hub-structure-viewport:active,
.hub-structure-viewport:focus-visible {
  cursor: grabbing;
  outline: none;
  box-shadow: none;
}

.hub-structure-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.hub-structure-viewport.is-structure-ready .hub-structure-canvas {
  opacity: 1;
}

/* World — revolving Earth fills the right-side stage */
.hub-world-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  container-type: inline-size;
}

.hub-world-viewport {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  overflow: hidden;
  touch-action: none;
  pointer-events: none;
  background: transparent;
}

.hub-world-viewport.is-world-interactive {
  pointer-events: auto;
  cursor: grab;
  user-select: none;
}

.hub-world-viewport.is-world-dragging,
.hub-world-viewport.is-world-dragging .hub-world-canvas {
  cursor: grabbing;
}

.hub-world-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.hub-world-viewport.is-world-ready .hub-world-canvas {
  opacity: 1;
}

.hub-world-credit {
  position: absolute;
  right: 0.65rem;
  bottom: 0.45rem;
  z-index: 2;
  margin: 0;
  padding: 0;
  font-size: 0.58rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.32);
  text-align: right;
  pointer-events: auto;
}

.hub-world-credit a {
  color: rgba(144, 202, 249, 0.65);
  text-decoration: none;
}

.hub-world-credit a:hover,
.hub-world-credit a:focus-visible {
  color: #90caf9;
  text-decoration: underline;
}

.hub-world-cloud-credit {
  display: block;
}

.hub-world-cloud-credit[hidden] {
  display: none;
}

.hub-world-fallback {
  margin: auto;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  text-align: center;
}

.hub-world-mine-caption {
  position: absolute;
  left: 0.75rem;
  top: 0.65rem;
  z-index: 3;
  margin: 0;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(12, 9, 4, 0.55);
  border: 1px solid rgba(255, 196, 80, 0.45);
  color: rgba(255, 236, 200, 0.92);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.hub-world-mines {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.hub-world-mine-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 8px));
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: rgba(16, 12, 6, 0.78);
  border: 1px solid rgba(255, 198, 84, 0.9);
  color: #fff6df;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
}

.hub-mined-source {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.68rem;
  line-height: 1.35;
}

.hub-mined-hint {
  margin: 0.15rem 0 0;
  color: rgba(255, 236, 200, 0.72);
  font-size: 0.75rem;
}

.hub-mined-country {
  appearance: none;
  margin: 0 0 0 -0.28rem;
  padding: 0.04rem 0.38rem;
  border: 0;
  border-radius: 0.35rem;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.hub-mined-country:hover,
.hub-mined-country:focus-visible {
  color: #ffe7b0;
  background: rgba(255, 186, 64, 0.2);
  outline: none;
}

.hub-mine-map {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(7, 9, 14, 0.96);
  color: #f6f3ea;
}

.hub-mine-map[hidden] {
  display: none;
}

.hub-mine-map-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem 0.35rem;
}

.hub-mine-map-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.hub-mine-map-close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
}

.hub-mine-map-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(11rem, 34%) minmax(0, 1fr);
}

.hub-mine-map-side {
  min-height: 0;
  overflow: auto;
  padding: 0 0.55rem 0.7rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-mine-svg {
  display: block;
  width: 100%;
  height: 9.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.6rem;
}

.hub-mine-land path {
  fill: rgba(255, 186, 64, 0.38);
  stroke: rgba(255, 244, 214, 0.9);
  stroke-width: 1.2;
}

.hub-mine-pin circle {
  fill: #fff6df;
  stroke: #c47b00;
  stroke-width: 1.2;
  cursor: pointer;
}

.hub-mine-pin text {
  fill: #fff6df;
  font-size: 11px;
  font-weight: 700;
}

.hub-mine-pin.is-selected circle {
  fill: #ffb020;
  r: 6;
}

.hub-mine-list {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hub-mine-pick {
  display: flex;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.28rem 0.2rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hub-mine-pick.is-selected {
  background: rgba(255, 186, 64, 0.14);
}

.hub-mine-pick strong,
.hub-mine-pick small {
  display: block;
}

.hub-mine-pick small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
}

.hub-mine-pick-index {
  flex: 0 0 auto;
  width: 1.2rem;
  font-weight: 700;
  color: #ffd27a;
}

.hub-mine-open {
  display: inline-block;
  margin: 0 0 0 1.65rem;
  color: #9ecbff;
  font-size: 0.72rem;
}

.hub-mine-empty {
  margin: 0.4rem 0;
  color: rgba(255, 255, 255, 0.7);
}

.hub-mine-map-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.hub-mine-style {
  display: flex;
  gap: 0.3rem;
  padding: 0.35rem 0.55rem 0.15rem;
}

.hub-mine-style button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.hub-mine-style button[aria-pressed='true'] {
  background: rgba(255, 186, 64, 0.22);
  border-color: rgba(255, 196, 80, 0.75);
  color: #ffe7b0;
}

.hub-mine-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 12rem;
  border: 0;
  background: #0e1218;
}

.hub-mine-map-note {
  margin: 0;
  padding: 0.35rem 0.6rem 0.5rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  line-height: 1.35;
}

@container (max-width: 520px) {
  .hub-mine-map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(10rem, 1fr);
  }

  .hub-mine-map-side {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    max-height: none;
    overflow: visible;
  }

  .hub-mine-list {
    max-height: 9.5rem;
    overflow: auto;
  }

  .hub-mine-svg {
    height: 7rem;
  }
}

/* Life — anatomy picture + rotating DNA, with white arrow overlays */
.hub-life-viewport {
  position: relative;
  --life-box: min(100cqw, 100cqh, 72vmin, 40rem);
  width: var(--life-box);
  height: var(--life-box);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: #0a1220;
}

.hub-life-art {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.hub-life-viewport.has-dna {
  width: min(100%, calc(var(--life-box) * 1.92));
  height: var(--life-box);
  max-width: 100%;
}

.hub-life-split {
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.hub-life-photo-slot {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
}

.hub-life-photo {
  position: relative;
  margin: 0;
  width: auto;
  height: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hub-life-photo-frame {
  position: relative;
  height: min(100%, 100cqh);
  width: calc(min(100%, 100cqh) * 3 / 4);
  aspect-ratio: 3 / 4;
  max-height: 100%;
}

.hub-life-photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  user-select: none;
  -webkit-user-drag: none;
}

.hub-life-viewport.has-dna .hub-life-photo-img {
  object-fit: contain;
  object-position: center center;
}

.hub-life-dna {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.hub-life-dna-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.hub-life-dna-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.hub-life-dna-stage.is-dna-ready .hub-life-dna-canvas {
  opacity: 1;
}

.hub-life-dna-legend {
  position: absolute;
  left: 0.55rem;
  top: 2.15rem;
  z-index: 2;
  display: flex;
  gap: 0.55rem;
  margin: 0;
  padding: 0.28rem 0.55rem;
  list-style: none;
  border-radius: 999px;
  background: rgba(8, 14, 26, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.68rem, 1.05vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.hub-life-dna-legend li {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.hub-life-dna-legend i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.hub-life-dna-label {
  position: absolute;
  left: 0.55rem;
  top: 0.55rem;
  z-index: 2;
  margin: 0;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 14, 26, 0.55);
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.68rem, 1.05vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.hub-life-arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.hub-life-arrow-shaft {
  stroke: #fff;
  stroke-width: 0.9;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.hub-life-arrow-head {
  fill: #fff;
}

.hub-life-arrow-label {
  fill: #fff;
  font: 700 3.4px system-ui, -apple-system, "Segoe UI", sans-serif;
  paint-order: stroke fill;
  stroke: rgba(10, 16, 28, 0.78);
  stroke-width: 0.85px;
}

.hub-life-arrow {
  animation: hub-life-arrow-bob 2.6s ease-in-out infinite;
}

@keyframes hub-life-arrow-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.4px); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-life-arrow {
    animation: none !important;
  }
}

.hub-structure-fs-btn {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.55rem 0.35rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 16, 26, 0.58);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: clamp(0.68rem, 1.1vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  opacity: 0;
  transition:
    opacity 0.28s ease,
    background 180ms ease,
    border-color 180ms ease;
}

.hub-structure-viewport.is-structure-ready .hub-structure-fs-btn,
.atom-shells-viewport .hub-structure-fs-btn {
  opacity: 1;
}

.hub-structure-fs-btn:hover,
.hub-structure-fs-btn:focus-visible {
  background: rgba(20, 28, 44, 0.78);
  border-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

.hub-structure-fs-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

.hub-structure-fs-btn .hub-structure-fs-icon-exit {
  display: none;
}

.hub-structure-fs-btn.is-active .hub-structure-fs-icon-expand {
  display: none;
}

.hub-structure-fs-btn.is-active .hub-structure-fs-icon-exit {
  display: block;
}

.hub-structure-fs-btn.is-active {
  background: rgba(100, 181, 246, 0.22);
  border-color: rgba(100, 181, 246, 0.45);
}

/* True fullscreen — presenter board for TV / projector */
.hub-structure-viewport:fullscreen,
.hub-structure-viewport:-webkit-full-screen,
.atom-shells-viewport:fullscreen,
.atom-shells-viewport:-webkit-full-screen,
.atom-shells-viewport.is-atom-board-shell {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  --structure-box: min(100vw, 100vh);
  border-radius: 0;
  background:
    radial-gradient(ellipse at 50% 40%, #121826 0%, #070a12 70%);
  cursor: default;
  overflow: hidden;
}

.atom-shells-viewport.is-atom-board-shell {
  position: fixed;
  inset: 0;
  z-index: 240;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

/* Move boundary: full screen except the right pencil dock */
.hub-structure-viewport.is-presenter-board .hub-structure-stage-area,
.atom-shells-viewport.is-presenter-board .hub-structure-stage-area {
  position: absolute;
  left: 0;
  top: 0;
  right: 5.5rem;
  bottom: 0;
  z-index: 2;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Rectangular 3D host — fills the stage (full screen minus pencil dock) */
.hub-structure-viewport.is-presenter-board .hub-structure-float,
.atom-shells-viewport.is-presenter-board .hub-structure-float {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}

.hub-structure-viewport.is-presenter-board .hub-structure-float:active,
.atom-shells-viewport.is-presenter-board .hub-structure-float:active {
  cursor: grabbing;
}

.hub-structure-viewport.is-presenter-board .hub-structure-canvas,
.atom-shells-viewport.is-presenter-board .atom-shells-canvas {
  pointer-events: auto;
  touch-action: none;
}

.hub-structure-viewport.is-presenter-board.is-move-mode .hub-structure-float,
.atom-shells-viewport.is-presenter-board.is-move-mode .hub-structure-float {
  cursor: grab;
}

.hub-structure-viewport.is-presenter-board.is-move-mode .hub-structure-float:active,
.atom-shells-viewport.is-presenter-board.is-move-mode .hub-structure-float:active {
  cursor: grabbing;
}

.hub-structure-viewport.is-presenter-board.is-pencil-mode .hub-structure-float,
.atom-shells-viewport.is-presenter-board.is-pencil-mode .hub-structure-float {
  cursor: default;
}

.hub-structure-viewport.is-presenter-board .hub-structure-canvas,
.atom-shells-viewport.is-presenter-board .atom-shells-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;
}

/* Exit sits beside Period 11™ (not on the molecule) */
.board-brand-chrome {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  z-index: 14;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: calc(100% - 7.5rem);
  pointer-events: none;
}

.board-brand-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  padding-top: 0.12rem;
}

.board-brand-aside .hub-structure-fs-btn {
  position: static;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.hub-element-board-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  margin: 0;
  max-width: min(36rem, 100%);
  color: #f5f7fa;
  font-size: clamp(1.35rem, 2.8vw, 2.15rem);
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.hub-element-board-shells {
  font-size: 0.62em;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: rgba(245, 247, 250, 0.86);
}

.board-brand-aside .hub-compound-board-title {
  position: static;
  top: auto;
  left: auto;
  max-width: min(42rem, 100%);
}

.hub-structure-viewport.is-presenter-board > .hub-structure-fs-btn,
.atom-shells-viewport.is-presenter-board > .hub-structure-fs-btn {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 12;
  transform: none;
}

/* Bond angles — compact control inside the right dock */
.hub-structure-pencil-dock .hub-structure-angle-switch.is-board-angle {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  z-index: auto;
  transform: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0.15rem 0;
  padding: 0.45rem 0.3rem;
  border-radius: 12px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

.hub-structure-pencil-dock .hub-structure-angle-switch.is-board-angle .hub-structure-angle-switch-label {
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  max-width: 3.2rem;
}

.hub-structure-sketch {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
  cursor: crosshair;
}

.hub-structure-viewport.is-presenter-board:not(.is-sketch-mode):not(.is-pencil-mode):not(.is-eraser-mode) .hub-structure-sketch,
.atom-shells-viewport.is-presenter-board:not(.is-sketch-mode):not(.is-pencil-mode):not(.is-eraser-mode) .hub-structure-sketch {
  pointer-events: none !important;
}

.hub-structure-viewport.is-sketch-mode .hub-structure-sketch,
.hub-structure-viewport.is-pencil-mode .hub-structure-sketch,
.hub-structure-viewport.is-eraser-mode .hub-structure-sketch,
.atom-shells-viewport.is-sketch-mode .hub-structure-sketch,
.atom-shells-viewport.is-pencil-mode .hub-structure-sketch,
.atom-shells-viewport.is-eraser-mode .hub-structure-sketch {
  pointer-events: auto;
}

/* Dock pencil glyph follows the chosen ink colour */
.hub-structure-pencil-btn {
  color: var(--pencil-ink, rgba(255, 255, 255, 0.92));
}

.hub-structure-pencil-btn svg {
  stroke: var(--pencil-ink, currentColor);
  color: var(--pencil-ink, currentColor);
  filter: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.85));
}

.hub-structure-pencil-btn.has-light-ink svg {
  filter:
    drop-shadow(0 0 0.6px rgba(0, 0, 0, 0.95))
    drop-shadow(0 0 2px rgba(0, 0, 0, 0.35));
}

.hub-structure-pencil-dock {
  position: absolute;
  top: 50%;
  right: 1rem;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transform: translateY(-50%);
  padding: 0.7rem 0.55rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 16, 26, 0.72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: calc(100vh - 1.5rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.hub-structure-move-btn,
.hub-structure-compare-btn,
.hub-structure-pencil-btn,
.hub-structure-eraser-btn,
.hub-structure-clear-btn,
.hub-structure-board-btn,
.hub-structure-color-swatch {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.hub-structure-clear-btn {
  flex-direction: column;
  gap: 0.12rem;
  height: auto;
  min-height: 2.75rem;
  padding: 0.35rem 0.2rem;
}

.hub-structure-dock-caption {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  color: rgba(255, 255, 255, 0.72);
}

.hub-structure-compare-btn {
  flex-direction: column;
  gap: 0.12rem;
  height: auto;
  min-height: 2.75rem;
  padding: 0.35rem 0.2rem;
}

.hub-structure-move-btn:hover,
.hub-structure-compare-btn:hover,
.hub-structure-pencil-btn:hover,
.hub-structure-eraser-btn:hover,
.hub-structure-clear-btn:hover,
.hub-structure-board-btn:hover,
.hub-structure-color-swatch:hover,
.hub-structure-move-btn:focus-visible,
.hub-structure-compare-btn:focus-visible,
.hub-structure-pencil-btn:focus-visible,
.hub-structure-eraser-btn:focus-visible,
.hub-structure-clear-btn:focus-visible,
.hub-structure-board-btn:focus-visible,
.hub-structure-color-swatch:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  outline: none;
}

.hub-structure-move-btn.is-active,
.hub-structure-compare-btn.is-active,
.hub-structure-pencil-btn.is-active,
.hub-structure-eraser-btn.is-active {
  background: rgba(100, 181, 246, 0.28);
  border-color: rgba(100, 181, 246, 0.55);
}

.hub-structure-move-btn.is-active,
.hub-structure-eraser-btn.is-active {
  color: #e3f2fd;
}

.hub-structure-pencil-btn.is-active {
  color: var(--pencil-ink, #e3f2fd);
}

.hub-structure-board-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
}

.hub-structure-board-btn {
  width: 2.35rem;
  height: 2.1rem;
  border-radius: 10px;
}

.hub-structure-board-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.hub-structure-board-index {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.88);
  font-variant-numeric: tabular-nums;
}

.hub-structure-color-swatch {
  border-radius: 8px;
  width: 2.1rem;
  height: 2.1rem;
  background: var(--c, #fff);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hub-structure-color-panel {
  position: absolute;
  right: calc(100% + 0.55rem);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1.85rem);
  gap: 0.4rem;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 16, 26, 0.92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.hub-structure-color-panel[hidden] {
  display: none !important;
}

.hub-structure-color-chip {
  appearance: none;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 6px;
  border: 2px solid transparent;
  background: var(--c, #fff);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.hub-structure-color-chip.is-selected,
.hub-structure-color-chip:focus-visible {
  border-color: #64b5f6;
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.2),
    0 0 0 2px rgba(100, 181, 246, 0.35);
}

.bb-compare-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.6rem, 1.5vmin, 1.4rem);
  background: rgba(4, 8, 16, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bb-compare-overlay[hidden] {
  display: none;
}

.bb-compare-dialog {
  width: min(96vw, 96rem);
  height: min(94vh, 64rem);
  max-height: min(94vh, 64rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 16, 26, 0.96);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  color: #eceff1;
}

.bb-compare-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.bb-compare-title {
  margin: 0 0 0.3rem;
  font-size: clamp(1.25rem, 2.2vmin, 1.55rem);
  font-weight: 750;
}

.bb-compare-hint {
  margin: 0;
  max-width: 52rem;
  font-size: clamp(0.95rem, 1.6vmin, 1.1rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

.bb-compare-close {
  appearance: none;
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
}

.bb-compare-picks {
  flex: 0 0 auto;
  margin: 0;
  font-size: clamp(1rem, 1.7vmin, 1.15rem);
  font-weight: 650;
  color: #ffe082;
}

.bb-compare-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}

/*
 * Match main .main-grid / .element-square:
 * sharp corners + ~2px gutters. Size cq units from the table itself
 * (not the dialog wrap), or 1cqw ≈ 14px and tiles look soft.
 */
.bb-compare-table-wrap .lab-mini-table {
  --lab-gap: 2px;
  container-type: inline-size;
  width: min(100cqw, calc(100cqh * 18 / 7));
  height: min(100cqh, calc(100cqw * 7 / 18));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  gap: 2px;
  column-gap: 2px;
  row-gap: 2px;
}

/* Main 7 periods + spacer + lanthanoid / actinoid annex rows */
.bb-compare-table-wrap .lab-mini-table.has-f-block {
  grid-template-rows:
    repeat(7, minmax(0, 1fr))
    minmax(0.2rem, 0.45fr)
    repeat(2, minmax(0, 1fr));
  width: min(100cqw, calc(100cqh * 18 / 10.2));
  height: min(100cqh, calc(100cqw * 10.2 / 18));
}

.bb-compare-table-wrap .lab-el-btn {
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 1px 2px rgba(0, 0, 0, 0.35);
  min-width: 0;
  min-height: 0;
}

.bb-compare-table-wrap .lab-el-btn:hover,
.bb-compare-table-wrap .lab-el-btn:focus-visible {
  transform: scale(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.55),
    0 4px 12px rgba(0, 0, 0, 0.35);
}

.bb-compare-table-wrap .lab-el-num {
  font-size: clamp(0.72rem, 2.1cqw, 1.15rem);
}

.bb-compare-table-wrap .lab-el-sym {
  font-size: clamp(1.15rem, 4.2cqw, 2.35rem);
}

.bb-compare-loading {
  margin: 0;
  padding: 1.5rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.7);
}

.lab-el-btn.is-host {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.bb-compare-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
}

.bb-compare-clear,
.bb-compare-done {
  appearance: none;
  border-radius: 12px;
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.bb-compare-clear {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
}

.bb-compare-done {
  border: 1px solid rgba(100, 181, 246, 0.55);
  background: rgba(100, 181, 246, 0.28);
  color: #e3f2fd;
}

.bb-compare-diff {
  position: absolute;
  inset: 0;
  right: 5.5rem;
  z-index: 11;
  overflow: hidden;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #eceff1;
  pointer-events: none;
  max-height: none;
}

.bb-compare-diff[hidden] {
  display: none;
}

.bb-diff-card {
  position: absolute;
  visibility: hidden;
  box-sizing: border-box;
  pointer-events: auto;
  padding: 0.32rem 0.4rem 0.42rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 14, 24, 0.86);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  container-type: inline-size;
}

.bb-diff-card-sym {
  margin: 0 0 0.2rem;
  text-align: center;
  font-size: clamp(0.72rem, 13cqi, 1.15rem);
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.15;
  overflow-wrap: break-word;
}

.bb-diff-card-props {
  margin: 0;
  display: grid;
  gap: 0.1rem;
}

.bb-diff-prop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem;
  font-size: clamp(0.58rem, 11cqi, 0.84rem);
  line-height: 1.25;
}

.bb-diff-prop dt {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 600;
  min-width: 0;
}

.bb-diff-prop dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

@container (max-width: 6.75rem) {
  .bb-diff-prop {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .bb-diff-prop dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-structure-fs-btn,
  .hub-structure-move-btn,
  .hub-structure-compare-btn,
  .hub-structure-pencil-btn,
  .hub-structure-eraser-btn,
  .hub-structure-clear-btn,
  .hub-structure-board-btn,
  .hub-structure-color-swatch {
    transition: none;
  }
}

.hub-structure-angle-switch {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.28rem 0.38rem 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(12, 16, 26, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.hub-structure-viewport.is-structure-ready .hub-structure-angle-switch {
  opacity: 1;
}

.hub-structure-angle-switch-label {
  font-size: clamp(0.68rem, 1.1vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}

.hub-structure-angle-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hub-structure-angle-switch-track {
  position: relative;
  width: 2.35rem;
  height: 1.28rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.hub-structure-angle-switch-track::after {
  content: '';
  position: absolute;
  top: 0.14rem;
  left: 0.14rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #f2f2f2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hub-structure-angle-switch input:checked + .hub-structure-angle-switch-track {
  background: #ce93d8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hub-structure-angle-switch input:checked + .hub-structure-angle-switch-track::after {
  transform: translateX(1.05rem);
}

.hub-structure-angle-switch input:focus-visible + .hub-structure-angle-switch-track {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .hub-structure-angle-switch,
  .hub-structure-angle-switch-track,
  .hub-structure-angle-switch-track::after {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-structure-canvas {
    transition: none;
  }
}

.hub-structure-hint {
  margin: 0;
  font-size: clamp(0.72rem, 1.15vw, 0.85rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.hub-structure-fallback {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
}

.hub-life-caption {
  position: absolute;
  left: 50%;
  bottom: 0.7rem;
  z-index: 4;
  margin: 0;
  max-width: min(92%, 26rem);
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  background: rgba(8, 14, 26, 0.62);
  color: #fff;
  font-size: clamp(0.72rem, 1.15vw, 0.88rem);
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  text-wrap: pretty;
}

.hub-structure-caption,
.hub-isotope-foot {
  margin: 0;
  max-width: none;
  text-align: inherit;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.35;
}

.hub-structure-angle {
  margin: 0;
  max-width: none;
  text-align: inherit;
  font-size: clamp(0.82rem, 1.35vw, 0.95rem);
  color: rgba(206, 147, 216, 0.92);
  line-height: 1.35;
}

.hub-structure-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem 0.75rem;
  margin: 0.15rem 0 0;
  font-size: clamp(0.75rem, 1.2vw, 0.88rem);
  color: rgba(255, 255, 255, 0.62);
}

.hub-structure-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--sw, #888);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  vertical-align: -0.05em;
}

.hub-structure-svg .hub-mol-atom text {
  font-family: inherit;
}

.hub-isotope-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
}

.hub-isotope-card {
  flex: 1 1 6.5rem;
  max-width: 9rem;
  min-width: 6rem;
  padding: 0.55rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.hub-isotope-card h4 {
  margin: 0 0 0.35rem;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
}

.hub-isotope-card ul {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: clamp(0.75rem, 1.2vw, 0.88rem);
  color: rgba(255, 255, 255, 0.8);
}

.hub-isotope-atom {
  position: relative;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto;
}

.hub-isotope-nucleus {
  position: absolute;
  inset: 32%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1a1a1a;
  font-weight: 800;
  font-size: 0.75rem;
  background:
    radial-gradient(ellipse 48% 40% at 30% 26%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 45%, transparent 75%),
    radial-gradient(circle at 78% 72%, rgba(210, 222, 236, 0.14) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.35) 100%),
    radial-gradient(circle at 34% 30%, #d8dbe1, var(--nucleus-fill, #9ea5ae) 55%, #3a3d42 100%);
  box-shadow:
    inset -2px -3px 5px rgba(0, 0, 0, 0.4),
    0 3px 7px rgba(0, 0, 0, 0.45);
}

.hub-isotope-ring {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

.hub-isotope-e {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: -0.42rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--el-electron, #ec407a);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
}

.hub-isotope-mass {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
}

.hub-panel-lede {
  margin: 0 0 0.45rem;
  font-size: inherit;
  line-height: 1.4;
}

.hub-panel-section {
  margin: 0.55rem 0 0;
}

.hub-panel-section h4,
.hub-force h4 {
  margin: 0 0 0.1rem;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: #e3f2fd;
}

.hub-panel-section p,
.hub-force p,
.hub-bond-item span,
.hub-form-list span,
.hub-compound-list span,
.hub-isotope-notes span {
  margin: 0;
  line-height: 1.4;
}

.hub-panel-section ul,
.hub-force ul,
.hub-bond-list,
.hub-form-list,
.hub-compound-list,
.hub-isotope-notes {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

.hub-bond-list,
.hub-form-list,
.hub-compound-list,
.hub-isotope-notes {
  list-style: none;
  padding-left: 0;
}

.hub-bond-item,
.hub-form-list li,
.hub-compound-list li,
.hub-isotope-notes li {
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hub-compound-list li {
  padding: 0;
}

.hub-compound-pick {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.hub-compound-list li:hover,
.hub-compound-list li:has(.hub-compound-pick:hover) {
  border-color: rgba(129, 212, 250, 0.38);
  background: rgba(255, 255, 255, 0.08);
}

.hub-compound-list li.is-selected,
.hub-compound-list li:has(.hub-compound-pick.is-selected) {
  border-color: rgba(129, 212, 250, 0.58);
  background: rgba(129, 212, 250, 0.14);
}

.hub-compound-pick:focus-visible {
  outline: 2px solid rgba(129, 212, 250, 0.85);
  outline-offset: -2px;
}

.hub-bond-item em {
  font-style: normal;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.55);
}

.hub-geometry-title {
  margin: 0.65rem 0 0.25rem;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: #ffe082;
}

.hub-geometry-item {
  border-color: rgba(255, 213, 79, 0.28);
  background: rgba(255, 213, 79, 0.08);
}

.hub-force-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.hub-force {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.atom-deck-drawn-copy .hub-panel-copy {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.atom-deck-drawn-copy .hub-panel-copy > .hub-panel-lede {
  margin-bottom: 0.25rem;
}

.atom-deck-drawn-copy .hub-panel-section {
  margin-top: 0.55rem;
}

.atom-deck-card,
.atom-deck-card--icon {
  --deck-icon: #90a4ae;
  --deck-icon-size: var(--name-line, 2.2rem);
  --dock-scale: 1;
  --dock-x: 0px;
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
  flex: 0 0 auto;
  width: var(--deck-icon-size);
  height: var(--deck-icon-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--deck-icon);
  font: inherit;
  cursor: pointer;
  overflow: visible;
  touch-action: manipulation;
  transform: translateX(var(--dock-x)) scale(var(--dock-scale));
  transform-origin: center center;
  will-change: transform;
  /* Track the pointer with no lag; ease only when the cursor leaves */
  transition: filter 140ms ease, background 140ms ease;
}

.atom-deck-stack--dock.is-dock-leaving .atom-deck-card--icon {
  transition:
    transform 180ms cubic-bezier(0.22, 0.9, 0.3, 1),
    filter 140ms ease,
    background 140ms ease;
}

.atom-deck-card:hover,
.atom-deck-card:focus-visible,
.atom-deck-card--icon:hover,
.atom-deck-card--icon:focus-visible {
  outline: none;
  filter: brightness(1.12);
}

.atom-deck-card.is-selected,
.atom-deck-card.is-front,
.atom-deck-card--icon.is-selected,
.atom-deck-card--icon.is-front {
  box-shadow: none;
}

/* Small white underline for the active icon */
.atom-deck-card--icon.is-selected::after,
.atom-deck-card--icon.is-front::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.12rem;
  width: 0.7rem;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .atom-deck-stack--dock .atom-deck-card--icon {
    transform: none !important;
    transition: background 140ms ease, filter 140ms ease;
  }
}

.atom-deck-card .atom-deck-icon,
.atom-deck-card--icon .atom-deck-icon,
.atom-deck-card--icon svg {
  width: calc(var(--deck-icon-size) * 0.72);
  height: calc(var(--deck-icon-size) * 0.72);
  display: block;
  color: var(--deck-icon);
  stroke: currentColor;
  pointer-events: none;
}

/* Hover name — same language as lab equipment titles (icon colour) */
.atom-deck-card-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.4rem);
  z-index: 40;
  margin: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 0;
  background: rgba(12, 12, 14, 0.94);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  color: var(--deck-icon, #90a4ae);
  font-size: clamp(0.68rem, 1.05vw, 0.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 160ms ease;
}

.atom-deck-card--icon:hover,
.atom-deck-card--icon:focus-visible {
  z-index: 45;
}

.atom-deck-card--icon:hover .atom-deck-card-name,
.atom-deck-card--icon:focus-visible .atom-deck-card-name {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .atom-deck-card-name {
    transition: none;
  }
}

/* Lab — continuous bubbling flask (invites the click) */
.atom-deck-card--react-flask {
  animation: react-flask-invite 2.6s ease-in-out infinite;
}

.atom-deck-icon--react-flask .react-flask-liquid {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: react-flask-liquid 2.8s ease-in-out infinite;
}

.atom-deck-icon--react-flask .react-flask-bubble {
  transform-box: fill-box;
  transform-origin: center;
  animation: react-flask-bubble 2.2s ease-in infinite;
}

.atom-deck-icon--react-flask .react-flask-bubble--a {
  animation-delay: 0s;
}

.atom-deck-icon--react-flask .react-flask-bubble--b {
  animation-delay: 0.55s;
}

.atom-deck-icon--react-flask .react-flask-bubble--c {
  animation-delay: 1.1s;
}

.atom-deck-icon--react-flask .react-flask-bubble--d {
  animation-delay: 1.65s;
}

@keyframes react-flask-invite {
  0%,
  100% {
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
  50% {
    filter: brightness(1.22) drop-shadow(0 0 6px color-mix(in srgb, var(--deck-icon) 55%, transparent));
  }
}

@keyframes react-flask-liquid {
  0%,
  100% {
    transform: scaleY(1) translateY(0);
  }
  50% {
    transform: scaleY(1.08) translateY(-0.4px);
  }
}

@keyframes react-flask-bubble {
  0% {
    transform: translateY(0) scale(0.45);
    opacity: 0;
  }
  12% {
    opacity: 0.95;
  }
  70% {
    opacity: 0.75;
  }
  100% {
    transform: translateY(-6.5px) scale(1.05);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atom-deck-card--react-flask,
  .atom-deck-icon--react-flask .react-flask-liquid,
  .atom-deck-icon--react-flask .react-flask-bubble {
    animation: none !important;
  }
}

/* Meet playback sits on the bottom edge. Pull the glass padding in
   so the controls are not floating above a tall empty band. */
.element-modal-inner:has(.atom-hub.is-meet-intro),
.element-modal-inner:has(.atom-hub.is-videos-stage) {
  padding-bottom: clamp(0.28rem, 0.55vw, 0.55rem);
}

/* Meet — intro copy fills the hub; Atomic Structure image is hidden */
.atom-hub.is-meet-intro {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.atom-hub.is-meet-intro .atom-hub-atom {
  display: none;
}

.atom-hub.is-meet-intro .atom-deck {
  width: 100%;
  max-width: none;
  margin: 0;
  justify-content: flex-start;
  container-type: size;
  container-name: meet-deck;
}

.atom-hub.is-meet-intro .atom-deck-drawn {
  overflow: visible;
  flex: 1 1 auto;
  min-height: 0;
}

.atom-hub.is-meet-intro .atom-deck-drawn-card--meet {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
}

/* Videos — the same card deck, full hub, films only */
.atom-hub.is-videos-stage {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.atom-hub.is-videos-stage .atom-hub-atom {
  display: none;
}

.atom-hub.is-videos-stage .atom-deck {
  width: 100%;
  max-width: none;
  margin: 0;
  justify-content: flex-start;
  container-type: size;
  container-name: meet-deck;
}

.atom-hub.is-videos-stage .atom-deck-drawn,
.atom-hub.is-videos-stage .atom-deck-drawn-card--videos {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

.meet-intro-stack.is-videos .meet-intro-stack-stage {
  height: 100%;
  min-height: 0;
}

.meet-intro-stack.is-videos .meet-media-host {
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* Atomic Structure — bare shells (no blue card chrome) */
.atom-hub.is-story-atom {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.atom-hub.is-story-atom .atom-hub-atom {
  display: none;
}

.atom-hub.is-story-atom .atom-deck {
  width: 100%;
  max-width: none;
  margin: 0;
  justify-content: stretch;
}

.atom-hub.is-story-atom .atom-deck-drawn {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.atom-deck-drawn-card.atom-deck-drawn-card--story {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  gap: 0;
}

.atom-hub.is-story-atom .story-atom-embed {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.atom-hub.is-story-atom .atom-diagram--compact {
  position: absolute;
  left: 0;
  right: 0;
  top: -1.5rem;
  bottom: 0;
  width: auto;
  height: auto;
  max-height: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  overflow: visible;
  z-index: 1;
  container-type: size;
  container-name: story-atom;
}

.atom-hub.is-story-atom .story-atom-embed {
  position: relative;
}

.atom-hub.is-story-atom .atom-diagram--compact .atom-visual-slot {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  max-height: none;
  margin: 0;
  overflow: visible;
}

.atom-hub.is-story-atom .atom-diagram--compact .atom-visual-card {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  padding: 0;
  overflow: visible;
}

.atom-hub.is-story-atom .atom-diagram--compact .atom-nucleus-hint,
.atom-hub.is-story-atom .atom-diagram--compact .atom-legend-card {
  position: static;
  left: auto;
  bottom: auto;
  z-index: auto;
  transform: none;
  flex-shrink: 0;
  width: 100%;
  text-align: center;
  line-height: 1.25;
  pointer-events: auto;
  font-size: clamp(0.8rem, 1.7cqh, 0.95rem);
}

.atom-hub.is-story-atom .atom-diagram--compact .atom-nucleus-hint {
  margin: 0 0 0.45rem;
}

.atom-hub.is-story-atom .atom-diagram--compact .atom-legend-card {
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.atom-hub.is-story-atom .atom-diagram--compact .atom-legend {
  font-size: inherit;
  gap: 0.2rem 0.35rem;
}

.meet-intro-stack {
  /* Viewport fallbacks, then container units when supported. */
  --meet-hand: 'Outfit', 'Segoe UI', sans-serif;
  --meet-accent: #f48fb1;
  --meet-card-w: clamp(14.5rem, 22vw, 24rem);
  --meet-card-h: clamp(20rem, 62vh, 40rem);
  --meet-spread-x: clamp(5.5rem, 11vw, 12.5rem);
  --meet-title-size: clamp(1.32rem, 1.15vw + 0.82rem, 2.15rem);
  --meet-section-size: clamp(1.15rem, 0.95vw + 0.78rem, 1.75rem);
  --meet-body-size: clamp(0.98rem, 0.8vw + 0.68rem, 1.42rem);
  --meet-bullet-gap: 0.9rem;
  --meet-pad: clamp(0.85rem, 1.05vw, 1.25rem);
  /* Fallback until the deck container can size the playback controls. */
  --meet-ctrl: 1.55rem;
  --meet-ctrl-icon: 0.72rem;
  --meet-dot: 0.32rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0.15rem 0.1rem 0;
  box-sizing: border-box;
}

@supports (width: 1cqw) {
  .meet-intro-stack {
    --meet-card-w: clamp(14.5rem, 24cqw, 24rem);
    --meet-card-h: clamp(20rem, 78cqh, 40rem);
    --meet-spread-x: clamp(5.5rem, 12.5cqw, 13.5rem);
    --meet-title-size: clamp(1.32rem, 2cqw + 0.72rem, 2.2rem);
    --meet-section-size: clamp(1.15rem, 1.55cqw + 0.68rem, 1.8rem);
    --meet-body-size: clamp(0.98rem, 1.15cqw + 0.6rem, 1.4rem);
    --meet-pad: clamp(0.85rem, 1.4cqw, 1.28rem);
  }

  .meet-intro-stack.has-about-tiles {
    --meet-card-w: clamp(13.5rem, 22cqw, 22.5rem);
    --meet-card-h: clamp(19rem, 76cqh, 38rem);
    --meet-spread-x: clamp(4rem, 10cqw, 9.5rem);
  }

  /* Smaller on every screen. The deck's shorter axis wins, so a wide
     stage shrinks with height and a tall stage shrinks with width. */
  .meet-intro-stack {
    --meet-ctrl: clamp(1.35rem, min(3.6cqh, 2.5cqw), 1.8rem);
    --meet-ctrl-icon: calc(var(--meet-ctrl) * 0.46);
    --meet-dot: clamp(0.3rem, min(0.85cqh, 0.58cqw), 0.38rem);
  }
}

.meet-intro-box {
  --meet-hand: 'Outfit', 'Segoe UI', sans-serif;
  --meet-accent: #f48fb1;
  position: relative;
  margin: 0;
  padding: 1.05rem 1.2rem 1.15rem;
  border-radius: 1.35rem;
  border: 2.5px solid color-mix(in srgb, var(--meet-accent) 70%, #fff);
  background:
    radial-gradient(
      120% 90% at 12% 0%,
      color-mix(in srgb, var(--meet-accent) 22%, transparent) 0%,
      transparent 46%
    ),
    linear-gradient(168deg, #2a2434 0%, #17141f 55%, #120f18 100%);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.48),
    0 0 0 3px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -10px 28px rgba(0, 0, 0, 0.28);
  transform-origin: 50% 50%;
  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 280ms ease,
    box-shadow 220ms ease;
}

/* Table deal: responsive card size from viewport/container; tilts stay mild */
.meet-intro-stack.is-dealing,
.meet-intro-stack.is-ready {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: center;
}

.meet-intro-stack-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  flex: 1 1 auto;
  width: 100%;
  height: min(72vh, 100%);
  min-height: clamp(18rem, 48vh, 28rem);
  padding: 0;
  overflow: hidden;
}

.meet-intro-stack.has-about-tiles .meet-intro-stack-stage {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.45rem 0.85rem;
}

.meet-intro-stack.has-about-tiles {
  --meet-card-w: clamp(13.5rem, 18vw, 22rem);
  --meet-card-h: clamp(19rem, 58vh, 38rem);
  --meet-spread-x: clamp(4rem, 8vw, 10rem);
}

.meet-intro-stack-cards {
  position: relative;
  z-index: 3;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  container-type: size;
  container-name: meet-cards;
  box-sizing: border-box;
  touch-action: pan-y;
}

.meet-about-tiles {
  position: absolute;
  inset: 0.4rem 0.4rem 0.4rem auto;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-content: stretch;
  gap: 0.55rem;
  width: min(14.5rem, 28%);
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.15rem 0.1rem 0.35rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.meet-intro-stack.has-about-tiles .meet-about-tiles {
  position: relative;
  inset: auto;
  width: auto;
  height: 100%;
  align-self: stretch;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.meet-about-tiles-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.meet-about-tiles-credit a:hover,
.meet-about-tiles-credit a:focus-visible {
  color: #fff8ff;
}

.meet-about-tile {
  position: relative;
  display: none;
  flex-direction: column;
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0.38rem 0.38rem 0.12rem;
  border-radius: 2px;
  border: 3px solid color-mix(in srgb, #c4a574 62%, var(--meet-accent, #f48fb1));
  background: #f3eee4;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.meet-about-tile.is-shown {
  display: flex;
  animation: meet-about-tile-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.meet-about-tiles:not(.is-yt-expanded) .meet-about-tile--video,
.meet-about-tiles:not(.is-yt-expanded) .meet-about-tile--found {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
}

.meet-about-tile--hero,
.meet-about-tile--found,
.meet-about-tile--tall,
.meet-about-tile--md,
.meet-about-tile--wide,
.meet-about-tile--sm {
  grid-column: auto;
  grid-row: auto;
}

@keyframes meet-about-tile-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .meet-about-tile.is-shown {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.meet-about-tile-img {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  background: #d7d0c4;
}

.meet-about-tile-caption {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  margin: 0.28rem 0.05rem 0.22rem;
  font-family: 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  color: #3d332c;
}

.meet-about-tile-kicker {
  font-size: clamp(0.48rem, 0.4vw + 0.38rem, 0.62rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6a5c50;
}

.meet-about-tile-subject {
  font-size: clamp(0.62rem, 0.5vw + 0.48rem, 0.82rem);
  letter-spacing: 0.02em;
  text-transform: none;
}

.meet-about-tile-credit {
  font-size: clamp(0.48rem, 0.38vw + 0.38rem, 0.62rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #6a5c50;
}

.meet-about-tiles-credit {
  flex: 0 0 auto;
  margin: 0.05rem 0.15rem 0;
  font-family: var(--meet-hand, 'Outfit', sans-serif);
  font-size: 0.82rem;
  line-height: 1.15;
  text-align: right;
  color: rgba(255, 248, 255, 0.5);
  pointer-events: auto;
}

.meet-intro-stack.is-videos .meet-about-tiles-credit {
  position: absolute;
  left: 50%;
  z-index: 40;
  width: min(92%, var(--meet-credit-w, var(--meet-media-w, 24rem)));
  margin: 0;
  text-align: center;
  top: calc(50% + (var(--meet-media-h, 22rem) / 2) + var(--meet-media-shift, 0px) + 0.7rem);
  transform: translateX(-50%);
  font-size: clamp(0.74rem, 0.35vw + 0.62rem, 0.95rem);
  line-height: 1.35;
  color: rgba(255, 248, 255, 0.68);
  pointer-events: auto;
}

.meet-intro-box {
  --meet-tilt: 0deg;
  --meet-x: 0px;
  --meet-y: 0px;
  --meet-scale: 1;
  --meet-peek: 1;
  --meet-blur: 0px;
}

.meet-intro-stack.is-dealing .meet-intro-box,
.meet-intro-stack.is-ready .meet-intro-box {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: var(--meet-card-w);
  height: var(--meet-card-h);
  max-width: min(36rem, var(--meet-card-w));
  max-height: min(46rem, var(--meet-card-h));
  margin: 0;
  padding: var(--meet-pad);
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: none;
  scrollbar-width: none;
  transform-origin: 50% 50%;
  transform: translate3d(calc(-50% + var(--meet-x)), calc(-50% + var(--meet-y)), 0)
    rotate(var(--meet-tilt)) scale(var(--meet-scale, 1));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
  filter: blur(var(--meet-blur, 0px));
  will-change: transform, filter, opacity;
  transition:
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease,
    filter 320ms ease,
    box-shadow 220ms ease;
}

.meet-intro-stack.is-dealing .meet-intro-box.is-dealt,
.meet-intro-stack.is-ready .meet-intro-box.is-dealt,
.meet-intro-stack.is-dealing .meet-intro-box.is-peek,
.meet-intro-stack.is-ready .meet-intro-box.is-peek,
.meet-intro-stack.is-dealing .meet-intro-box.is-front,
.meet-intro-stack.is-ready .meet-intro-box.is-front {
  opacity: var(--meet-peek, 1);
  visibility: visible;
  pointer-events: auto;
  cursor: pointer;
  user-select: text;
}

.meet-intro-stack.is-dealing .meet-intro-box.is-front,
.meet-intro-stack.is-ready .meet-intro-box.is-front {
  opacity: 1;
  z-index: 50;
  filter: none;
  pointer-events: auto;
  cursor: default;
}

.meet-intro-stack.is-dealing .meet-intro-box--found,
.meet-intro-stack.is-ready .meet-intro-box--found {
  display: flex;
  flex-direction: column;
}

.meet-found-card {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0.15rem 0 0;
  border-radius: 0.7rem;
  overflow: hidden;
  background: #120f18;
}

.meet-found-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.meet-found-credit {
  flex: 0 0 auto;
  margin: 0.35rem 0 0;
  font-family: var(--meet-hand, 'Outfit', sans-serif);
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: right;
  color: rgba(255, 248, 255, 0.5);
}

.meet-intro-stack .meet-intro-box.is-peek {
  cursor: pointer;
}

.meet-intro-stack .meet-intro-box.is-arriving {
  animation: none;
}

@keyframes meet-card-deal {
  from {
    opacity: 0;
    transform: translate(calc(-50% + var(--meet-x) + 18%), calc(-50% + var(--meet-y)))
      rotate(var(--meet-tilt)) scale(0.78);
  }
  to {
    opacity: var(--meet-peek, 1);
    transform: translate(calc(-50% + var(--meet-x)), calc(-50% + var(--meet-y)))
      rotate(var(--meet-tilt)) scale(var(--meet-scale, 1));
  }
}

@media (prefers-reduced-motion: reduce) {
  .meet-intro-stack .meet-intro-box.is-arriving {
    animation: none;
  }

  .meet-intro-box {
    transition: opacity 160ms ease, box-shadow 160ms ease;
  }

  .meet-intro-stack.is-dealing .meet-intro-box,
  .meet-intro-stack.is-ready .meet-intro-box {
    transition: opacity 160ms ease, box-shadow 160ms ease;
  }
}

.meet-intro-stack.is-dealing .meet-intro-box .meet-intro-title.atom-deck-drawn-title,
.meet-intro-stack.is-ready .meet-intro-box .meet-intro-title.atom-deck-drawn-title {
  font-size: var(--meet-title-size);
  margin: 0 2.2rem 0.55rem 0;
}

.meet-intro-stack.is-dealing .meet-intro-box .meet-intro-title--section.atom-deck-drawn-title,
.meet-intro-stack.is-ready .meet-intro-box .meet-intro-title--section.atom-deck-drawn-title {
  font-size: var(--meet-section-size);
  margin-right: 0;
  color: #fff8ff;
}

.meet-intro-stack.is-dealing .meet-intro-line,
.meet-intro-stack.is-ready .meet-intro-line,
.meet-intro-stack.is-dealing .meet-intro-props-list,
.meet-intro-stack.is-ready .meet-intro-props-list {
  font-size: var(--meet-body-size);
  line-height: 1.28;
  overflow-wrap: break-word;
}

.meet-intro-stack.is-dealing .meet-intro-line,
.meet-intro-stack.is-ready .meet-intro-line {
  margin-bottom: var(--meet-bullet-gap);
}

.meet-about-tile--video {
  pointer-events: auto;
  z-index: 2;
  cursor: pointer;
}

.meet-about-tile--video .meet-yt {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.meet-about-tile--video .meet-yt-frame {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 5.5rem;
  overflow: hidden;
  background: #1a1612;
}

.meet-yt-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.meet-yt-mount iframe,
.meet-about-tile--video .meet-yt-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.meet-about-tile--video.is-yt-playing .meet-yt-play {
  opacity: 0;
  pointer-events: none;
}

.meet-about-tile--video .meet-yt-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #1a1612;
  cursor: pointer;
}

.meet-about-tile--video .meet-yt-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.meet-about-tile--video .meet-yt-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.55rem;
  height: 2.55rem;
  margin: -1.275rem 0 0 -1.275rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.45),
    0 0 0 3px rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.meet-about-tile--video .meet-yt-play-badge::after {
  content: '';
  position: absolute;
  left: 0.98rem;
  top: 0.72rem;
  border-style: solid;
  border-width: 0.56rem 0 0.56rem 0.92rem;
  border-color: transparent transparent transparent #fff;
}

.meet-about-tile--video .meet-yt-play:hover .meet-yt-play-badge,
.meet-about-tile--video .meet-yt-play:focus-visible .meet-yt-play-badge {
  background: #c62828;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.45),
    0 0 0 3px rgba(255, 255, 255, 0.55);
}

.meet-yt-size {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 14, 16, 0.88);
  color: #fff8ff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  pointer-events: auto;
}

.meet-yt-size:hover,
.meet-yt-size:focus-visible {
  background: rgba(18, 14, 16, 0.94);
  outline: 2px solid rgba(255, 248, 255, 0.55);
  outline-offset: 1px;
}

.meet-yt-size .atom-deck-icon,
.meet-yt-size svg {
  width: 1.05rem;
  height: 1.05rem;
}

.meet-yt-size-icon--shrink {
  display: none;
}

.meet-about-tiles.is-yt-expanded .meet-yt-size-icon--enlarge,
.meet-intro-stack.has-yt-expanded .meet-yt-size-icon--enlarge {
  display: none;
}

.meet-about-tiles.is-yt-expanded .meet-yt-size-icon--shrink,
.meet-intro-stack.has-yt-expanded .meet-yt-size-icon--shrink {
  display: block;
}

.meet-intro-stack.has-yt-expanded .meet-intro-stack-stage {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.meet-intro-stack.has-yt-expanded .meet-intro-stack-cards {
  display: none;
}

.meet-about-tiles.is-yt-expanded,
.meet-intro-stack.has-yt-expanded .meet-about-tiles {
  position: relative;
  inset: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.12rem;
  width: auto;
  height: 100%;
  min-height: 0;
  z-index: 12;
}

.meet-about-tiles.is-yt-expanded .meet-about-tile:not(.meet-about-tile--video),
.meet-about-tiles.is-yt-expanded .meet-about-tiles-credit {
  display: none !important;
}

.meet-about-tiles.is-yt-expanded .meet-about-tile--video {
  position: relative;
  inset: auto;
  z-index: 8;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  grid-column: auto;
  grid-row: auto;
  display: flex !important;
  flex-direction: column;
  cursor: default;
}

.meet-about-tiles.is-yt-expanded .meet-about-tile--video .meet-yt {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.meet-about-tiles.is-yt-expanded .meet-about-tile--video .meet-yt-frame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

.meet-about-tiles.is-yt-expanded .meet-about-tile--video .meet-yt-frame iframe,
.meet-about-tiles.is-yt-expanded .meet-yt-mount,
.meet-about-tiles.is-yt-expanded .meet-yt-mount iframe {
  width: 100% !important;
  height: 100% !important;
}

.meet-about-tiles.is-yt-expanded .meet-about-tile--video .meet-about-tile-caption {
  display: none;
}

.meet-about-tile--video .meet-about-tile-subject {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meet-about-tiles .meet-about-tile.meet-media-host,
.meet-intro-stack.is-videos .meet-media-host {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  animation: none;
  cursor: default;
}

.meet-media-stack {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.meet-intro-stack.is-dealing .meet-media-stack .meet-media-card,
.meet-intro-stack.is-ready .meet-media-stack .meet-media-card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: var(--meet-media-w, 28rem);
  height: var(--meet-media-h, 20rem);
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0.55rem 0.55rem 0.65rem;
  box-sizing: border-box;
  overflow: hidden;
  transform: translate3d(
      calc(-50% + var(--meet-x, 0px)),
      calc(-50% + var(--meet-y, 0px)),
      0
    )
    scale(var(--meet-scale, 1));
  opacity: var(--meet-peek, 1);
  filter: blur(var(--meet-blur, 0px));
  pointer-events: auto;
}

.meet-intro-stack.is-dealing .meet-media-stack .meet-media-card.is-peek,
.meet-intro-stack.is-ready .meet-media-stack .meet-media-card.is-peek {
  cursor: pointer;
}

.meet-intro-stack.is-dealing .meet-media-stack .meet-media-card.is-front,
.meet-intro-stack.is-ready .meet-media-stack .meet-media-card.is-front {
  cursor: default;
  filter: none;
  opacity: 1;
}

.meet-media-card-face {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0.7rem;
  overflow: hidden;
  background: #120f18;
}

.meet-media-card-still {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.meet-media-card-face > .meet-yt {
  position: absolute;
  inset: 0;
  z-index: 2;
  height: 100%;
}

.meet-media-card-face > .meet-yt-play-badge {
  z-index: 1;
}

.meet-media-card:not(.is-front) .meet-yt,
.meet-media-card:not(.is-front) .meet-yt-size {
  visibility: hidden;
  pointer-events: none;
}

.meet-media-stack .meet-media-card-title {
  flex: 0 0 auto;
  margin: 0.42rem 0.12rem 0.05rem !important;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meet-media-card.is-peek:hover .meet-yt-play-badge,
.meet-media-card.is-peek:focus-visible .meet-yt-play-badge {
  background: #c62828;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.45),
    0 0 0 3px rgba(255, 255, 255, 0.55);
}

.meet-about-tiles.is-yt-expanded .meet-media-card:not(.is-front),
.meet-intro-stack.has-yt-expanded .meet-media-card:not(.is-front) {
  display: none !important;
}

.meet-about-tiles.is-yt-expanded .meet-media-stack,
.meet-intro-stack.has-yt-expanded .meet-media-stack {
  display: flex;
}

.meet-intro-stack.has-yt-expanded .meet-about-tiles-credit {
  display: none;
}

.meet-about-tiles.is-yt-expanded .meet-media-card.is-front,
.meet-intro-stack.has-yt-expanded .meet-media-card.is-front {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none;
  transform: none !important;
  filter: none !important;
  opacity: 1 !important;
}

.meet-intro-stack.has-yt-expanded .meet-media-card.is-front .meet-media-card-face,
.meet-intro-stack.has-yt-expanded .meet-media-card.is-front .meet-yt,
.meet-intro-stack.has-yt-expanded .meet-media-card.is-front .meet-yt-frame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* Carousel layout: --meet-scale / --meet-x are set per card in JS. */
.meet-intro-stack .meet-intro-box--nobel {
  --meet-accent: #e040fb;
  border-color: #e040fb;
  background:
    radial-gradient(
      120% 90% at 12% 0%,
      color-mix(in srgb, #ffd54f 20%, transparent) 0%,
      transparent 46%
    ),
    linear-gradient(168deg, #2a2434 0%, #17141f 55%, #120f18 100%);
}

.meet-nobel-portraits {
  --meet-portrait-size: min(12.5rem, 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.55rem 0.9rem;
  margin: 0.08rem 0 0.5rem;
  width: 100%;
}

.meet-nobel-portrait {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  flex: 0 0 auto;
  width: var(--meet-portrait-size);
  max-width: var(--meet-portrait-size);
  min-width: 0;
}

.meet-nobel-portrait-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  align-self: center;
  width: var(--meet-portrait-size);
  aspect-ratio: 1 / 1;
  height: auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, #ffd54f 70%, #fff);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  background: #1a1520;
}

.meet-nobel-portrait-img {
  display: block;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
  object-position: center center;
}

.meet-nobel-portrait-caption {
  font-family: var(--meet-hand);
  font-size: calc(var(--meet-body-size) * 0.92);
  line-height: 1.2;
  text-align: center;
  color: #fff3c4;
  max-width: 100%;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.meet-intro-box--discovery .meet-nobel-portraits {
  --meet-portrait-size: min(10.25rem, 100%);
}

.meet-nobel-laureates {
  font-weight: 600;
  color: #fff3c4;
}

.meet-nobel-citation {
  font-style: italic;
  color: #ffe8a3;
}

.meet-intro-box--discovery .meet-nobel-portrait-frame {
  border-color: color-mix(in srgb, #ce93d8 75%, #fff);
  background: #1a1524;
}

.meet-discoverer-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
}

.meet-discoverer-name {
  display: block;
}

.meet-discoverer-year {
  display: block;
  font-size: calc(var(--meet-body-size) * 0.82);
  line-height: 1.1;
  color: #ffe082;
}

.meet-discoverer-frame.is-missing {
  display: none;
}

.meet-discoverer-frame:not(.has-photo):not(.is-missing) .meet-nobel-portrait-img:not([src]) {
  visibility: hidden;
}

.meet-intro-box--discovery-2 .meet-intro-line,
.meet-intro-box--discovery-3 .meet-intro-line {
  font-size: calc(var(--meet-body-size) * 0.9);
  line-height: 1.28;
}

.meet-intro-box--discovery-3 .meet-intro-line {
  font-size: calc(var(--meet-body-size) * 0.84);
  margin-bottom: var(--meet-bullet-gap);
}

.meet-intro-box--discovery-3 .meet-intro-title--section.atom-deck-drawn-title {
  font-size: calc(var(--meet-section-size) * 0.9);
  margin-bottom: 0.4rem;
}

.meet-dyk-list {
  gap: var(--meet-bullet-gap);
}

.meet-info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--meet-bullet-gap);
}

.meet-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
}

.meet-info-icon {
  flex: 0 0 auto;
  width: clamp(2.4rem, 3.2cqw + 1.4rem, 3.25rem);
  height: clamp(2.4rem, 3.2cqw + 1.4rem, 3.25rem);
  margin-top: 0.05em;
  display: grid;
  place-items: center;
  color: var(--fact-color, #9ccc65);
}

.meet-info-icon svg,
.meet-info-icon .atom-deck-icon {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
  stroke-width: 1.75;
}

.meet-info-label {
  min-width: 0;
  flex: 1;
  font-family: var(--meet-hand);
  font-size: var(--meet-body-size);
  font-weight: 500;
  line-height: 1.25;
  color: #ffe8ff;
  white-space: pre-wrap;
}

.meet-intro-stack .meet-intro-box.is-front {
  outline: none;
  filter: none;
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.62),
    0 0 0 2px color-mix(in srgb, var(--meet-accent) 55%, #fff),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.meet-intro-stack .meet-intro-box.is-peek {
  filter: blur(var(--meet-blur, 1.4px)) saturate(0.92) brightness(0.9);
}

.meet-intro-stack-dot.is-dealt {
  background: color-mix(in srgb, var(--meet-accent) 55%, rgba(255, 255, 255, 0.35));
}

.meet-intro-stack-hint {
  display: none;
}

@media (max-width: 1100px) {
  .meet-intro-stack {
    --meet-card-w: clamp(14.25rem, 26vw, 20.5rem);
    --meet-card-h: clamp(18.5rem, 58vh, 32rem);
    --meet-spread-x: clamp(4.25rem, 10vw, 9rem);
  }

  .meet-intro-stack.has-about-tiles {
    --meet-card-w: clamp(13.5rem, 24vw, 20rem);
    --meet-spread-x: clamp(3.5rem, 7vw, 8rem);
  }

  .meet-about-tiles {
    gap: 0.36rem;
    padding: 0.1rem 0 0.25rem;
  }
}

@media (max-width: 820px) {
  .meet-intro-stack {
    --meet-card-w: clamp(14rem, 42vw, 19.5rem);
    --meet-card-h: clamp(18rem, 54vh, 28rem);
    --meet-spread-x: clamp(3.25rem, 12vw, 6.5rem);
    --meet-title-size: clamp(1.18rem, 2.6vw + 0.52rem, 1.6rem);
    --meet-section-size: clamp(1.05rem, 2.2vw + 0.48rem, 1.35rem);
    --meet-body-size: clamp(0.92rem, 1.7vw + 0.45rem, 1.12rem);
  }

  .meet-intro-stack-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }

  .meet-about-tiles {
    gap: 0.28rem;
    padding: 0;
  }

  .meet-about-tile-caption {
    display: none;
  }
}

@media (max-width: 640px) {
  .meet-intro-stack.has-about-tiles .meet-intro-stack-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(12rem, 3fr) minmax(8.5rem, 2fr);
    gap: 0.5rem;
    height: min(78vh, 100%);
  }

  .meet-intro-stack.has-yt-expanded .meet-intro-stack-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (min-width: 1500px) {
  .meet-intro-stack {
    --meet-title-size: clamp(1.55rem, 0.95vw + 0.95rem, 2.25rem);
    --meet-section-size: clamp(1.28rem, 0.75vw + 0.82rem, 1.85rem);
    --meet-body-size: clamp(1.05rem, 0.6vw + 0.7rem, 1.42rem);
  }
}

@container meet-deck (max-width: 640px) {
  .meet-intro-stack.has-about-tiles .meet-intro-stack-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(12rem, 3fr) minmax(8.5rem, 2fr);
    gap: 0.5rem;
  }

  .meet-intro-stack.has-yt-expanded .meet-intro-stack-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
}

.meet-intro-stack-meta {
  position: relative;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  padding: 0 0.1rem;
}

.meet-intro-stack-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
}

.meet-intro-ctrl {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--meet-ctrl);
  height: var(--meet-ctrl);
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  color: rgba(255, 245, 255, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 120ms ease,
    opacity 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

.meet-intro-ctrl-icon {
  display: block;
  width: var(--meet-ctrl-icon);
  height: var(--meet-ctrl-icon);
  pointer-events: none;
  color: inherit;
}

.meet-intro-ctrl-icon svg,
.meet-intro-ctrl-icon .atom-deck-icon,
.meet-intro-ctrl-icon i {
  width: 100%;
  height: 100%;
  display: block;
  color: inherit;
  stroke: currentColor;
}

.meet-intro-ctrl--pause .meet-intro-ctrl-icon--play {
  display: none;
}

.meet-intro-ctrl--pause.is-paused .meet-intro-ctrl-icon--pause {
  display: none;
}

.meet-intro-ctrl--pause.is-paused .meet-intro-ctrl-icon--play {
  display: block;
}

.meet-intro-ctrl--next,
.meet-intro-ctrl--pause.is-paused {
  border-color: color-mix(in srgb, var(--meet-accent) 65%, #fff);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--meet-accent) 92%, #fff) 0%,
      color-mix(in srgb, var(--meet-accent) 72%, #5a2080) 100%
    );
  color: #1a1020;
  box-shadow:
    0 2px 0 color-mix(in srgb, var(--meet-accent) 45%, #000),
    0 3px 10px color-mix(in srgb, var(--meet-accent) 35%, transparent);
}

.meet-intro-ctrl:hover:not(:disabled),
.meet-intro-ctrl:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  outline: none;
}

.meet-intro-ctrl--next:hover:not(:disabled),
.meet-intro-ctrl--next:focus-visible:not(:disabled),
.meet-intro-ctrl--pause.is-paused:hover:not(:disabled),
.meet-intro-ctrl--pause.is-paused:focus-visible:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #1a1020;
  outline: none;
}

.meet-intro-ctrl[hidden],
.meet-intro-stack.is-at-end [data-meet-next],
.meet-intro-stack.is-ready [data-meet-pause] {
  display: none !important;
}

.meet-intro-ctrl:disabled,
.meet-intro-ctrl--next:disabled,
.meet-intro-ctrl--pause.is-paused:disabled {
  opacity: 0.38;
  cursor: default;
  transform: none;
  filter: none;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.meet-intro-ctrl:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--meet-accent) 70%, transparent);
}

.meet-intro-stack-dots {
  display: flex;
  gap: 0.26rem;
  align-items: center;
}

.meet-intro-stack-dot {
  width: var(--meet-dot);
  height: var(--meet-dot);
  border-radius: 999px;
  background: color-mix(in srgb, var(--meet-accent) 35%, rgba(255, 255, 255, 0.2));
  transition: transform 180ms ease, background 180ms ease;
}

.meet-intro-stack-dot.is-jumpable {
  cursor: pointer;
}

.meet-intro-stack-dot.is-current {
  transform: scale(1.35);
  background: color-mix(in srgb, var(--meet-accent) 85%, #fff);
}

.meet-intro-stack.is-spread .meet-intro-stack-dot.is-active {
  background: color-mix(in srgb, var(--meet-accent) 55%, rgba(255, 255, 255, 0.35));
}

.meet-intro-stack-hint {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.meet-intro-box .meet-intro-title.atom-deck-drawn-title {
  position: relative;
  margin: 0 2.4rem 0.65rem 0;
  font-family: var(--meet-hand);
  font-size: clamp(1.85rem, 2.2vw + 1.1rem, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: #fff8ff;
}

.meet-intro-box .meet-intro-title--section.atom-deck-drawn-title {
  margin-right: 0;
  font-size: clamp(1.55rem, 1.6vw + 1.1rem, 2rem);
  color: #fff8ff;
}

.meet-intro-icon {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  color: var(--meet-accent, #f48fb1);
  pointer-events: none;
  z-index: 2;
}

.meet-intro-icon svg,
.meet-intro-icon .atom-deck-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  color: inherit;
  stroke: currentColor;
}

.meet-intro-box::before {
  content: '';
  position: absolute;
  inset: 0.45rem;
  border-radius: 0.85rem 1rem 0.8rem 1.05rem;
  border: 1.5px dashed
    color-mix(in srgb, var(--meet-accent) 42%, rgba(255, 255, 255, 0.18));
  pointer-events: none;
  opacity: 0.85;
}

.meet-intro-line {
  position: relative;
  margin: 0 0 var(--meet-bullet-gap);
  font-family: var(--meet-hand);
  font-size: clamp(1.35rem, 1.15vw + 1.05rem, 1.7rem);
  font-weight: 500;
  line-height: 1.28;
  color: #f0d4ff;
}

.meet-intro-line:last-child {
  margin-bottom: 0;
}

.meet-intro-about-line {
  color: #ffe4f4;
}

.meet-intro-props-list {
  margin: 0;
  padding: 0 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: var(--meet-bullet-gap);
  font-family: var(--meet-hand);
  font-size: var(--meet-body-size, clamp(1rem, 0.8vw + 0.7rem, 1.4rem));
  font-weight: 500;
  line-height: 1.32;
  color: #ffe8ff;
  overflow-wrap: break-word;
}

.meet-intro-dim-line {
  margin-bottom: var(--meet-bullet-gap);
}

.meet-intro-props-list--dim {
  gap: var(--meet-bullet-gap);
}

.meet-intro-props-list--dim li + li {
  margin-top: 0;
}

.meet-intro-stack.is-dealing .meet-intro-box--durability,
.meet-intro-stack.is-ready .meet-intro-box--durability {
  --meet-accent: #ffb74d;
}

.meet-intro-stack.is-dealing .meet-intro-box--rarity,
.meet-intro-stack.is-ready .meet-intro-box--rarity {
  --meet-accent: #81d4fa;
}

.meet-intro-stack.is-dealing .meet-intro-box--discovery,
.meet-intro-stack.is-ready .meet-intro-box--discovery {
  --meet-accent: #ce93d8;
}

.meet-intro-props-list .acronym-info {
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.28rem;
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  font-style: italic;
  vertical-align: 0.18em;
}

.atom-deck-drawn {
  min-width: 0;
  min-height: 0;
  position: relative;
  z-index: 50;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.atom-deck-drawn-empty {
  margin: 0;
  height: 100%;
  min-height: 4rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.atom-deck-drawn-card {
  /* Match header icon tray sizing */
  --name-line: calc(1.05 * clamp(1.75rem, 3vw, 2.75rem));
  --deck-icon-size: var(--name-line);
  --drawn-icon: #90caf9;
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: clamp(0.7rem, 1.4vw, 1rem);
  border: 1px solid rgba(100, 181, 246, 0.4);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(100, 181, 246, 0.16), rgba(255, 255, 255, 0.06) 40%, rgba(0, 0, 0, 0.22));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transform-origin: 50% 0%;
  overflow: hidden;
}

/* Meet uses only the angled card — no outer blue frame */
.atom-deck-drawn-card.atom-deck-drawn-card--meet {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  gap: 0;
}

.atom-deck-drawn-icon {
  position: absolute;
  top: clamp(0.55rem, 1.2vw, 0.8rem);
  right: clamp(0.55rem, 1.2vw, 0.8rem);
  width: var(--deck-icon-size);
  height: var(--deck-icon-size);
  display: grid;
  place-items: center;
  color: var(--drawn-icon);
  pointer-events: none;
  z-index: 2;
}

.atom-deck-drawn-icon svg,
.atom-deck-drawn-icon .atom-deck-icon {
  width: calc(var(--deck-icon-size) * 0.72);
  height: calc(var(--deck-icon-size) * 0.72);
  display: block;
  color: inherit;
  stroke: currentColor;
}

.atom-deck-drawn-card.is-drawing {
  animation: atom-deck-draw 420ms cubic-bezier(0.18, 0.9, 0.22, 1);
}

.atom-deck-drawn-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.atom-deck-drawn-title {
  margin: 0;
  margin-right: calc(var(--deck-icon-size) + 0.35rem);
  flex-shrink: 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #e3f2fd;
}

.atom-deck-drawn-hint {
  margin: 0;
  flex-shrink: 0;
  font-size: clamp(0.85rem, 1.4vw, 0.98rem);
  color: rgba(255, 255, 255, 0.55);
}

/* Scroll long copy inside the card — no more… on hub cards */
.atom-deck-drawn-copy {
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  font-size: clamp(0.95rem, 1.7vw, 1.12rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

/* Bonds (and any paged hub panel): pages instead of scroll */
.atom-deck-drawn-card[data-deck-aspect="bonds"] .atom-deck-drawn-copy,
.atom-deck-drawn-copy:has([data-hub-pages]) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hub-panel-pages {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  gap: 0.55rem;
  cursor: pointer;
}

.hub-panel-page-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.hub-panel-page {
  display: block;
  min-height: 0;
  animation: hub-page-in 220ms ease;
}

.hub-panel-page[hidden] {
  display: none !important;
}

@keyframes hub-page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-panel-page {
    animation: none;
  }
}

.hub-panel-pager {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.15rem;
}

.hub-panel-pager-hint {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.hub-panel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.hub-panel-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.hub-panel-dot.is-active {
  background: rgba(77, 182, 172, 0.95);
  border-color: rgba(77, 182, 172, 1);
  box-shadow: 0 0 0 3px rgba(77, 182, 172, 0.22);
}

.hub-panel-dot:focus-visible {
  outline: 2px solid rgba(77, 182, 172, 0.85);
  outline-offset: 2px;
}

/* Bonds + molecule: fill the left column; card pages, no deck scroll */
.atom-hub.has-hub-visual.has-bond-molecule .atom-deck {
  overflow: hidden;
  height: 100%;
  max-height: 100%;
}

.atom-hub.has-hub-visual.has-bond-molecule .atom-deck-drawn {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.atom-hub.has-hub-visual.has-bond-molecule .atom-deck-drawn-card {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
}

.atom-hub.has-hub-visual.has-bond-molecule .atom-deck-drawn-body {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.atom-hub.has-hub-visual.has-bond-molecule .atom-deck-drawn > .hub-structure-meta {
  flex: 0 0 auto;
  max-height: 28%;
  overflow: hidden;
}

.atom-deck-drawn-copy::-webkit-scrollbar {
  width: 6px;
}

.atom-deck-drawn-copy::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.atom-deck-hazards {
  list-style: none;
  margin: 0.15rem 0 0.35rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex-shrink: 0;
}

.atom-deck-hazard {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 3.4rem;
}

.atom-deck-hazard-badge {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.45rem;
  color: #1a1200;
  background: #f9a825;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.atom-deck-hazard-badge svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
  color: inherit;
  stroke: currentColor;
  fill: none;
}

.atom-deck-hazard-name {
  font-size: clamp(0.72rem, 1.2vw, 0.85rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  line-height: 1.2;
}

.atom-deck-hazards-empty {
  margin: 0.1rem 0 0.35rem;
  flex-shrink: 0;
  font-size: clamp(0.85rem, 1.4vw, 0.98rem);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
}

.atom-deck-drawn-text {
  margin: 0;
  font: inherit;
  color: inherit;
}

.atom-deck-drawn-copy .atom-deck-drawn-text + .atom-deck-drawn-text {
  margin-top: 0.75rem;
}

.atom-deck-drawn-copy .modal-about-facts {
  margin-bottom: 0.7rem;
  padding-right: min(22rem, 62%);
}

.atom-deck-drawn-copy .modal-list {
  font-size: inherit;
  line-height: 1.45;
}

.atom-deck-drawn-copy .atom-deck-properties {
  margin-top: 0.85rem;
}

.atom-deck-secret h4 {
  color: #ce93d8;
}

.atom-deck-secret p {
  margin: 0;
  font-size: inherit;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.86);
}

.atom-deck-drawn-copy .modal-human-value {
  margin: 0 0 0.65rem;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  letter-spacing: -0.02em;
  color: #c8e6c9;
}

.atom-deck-drawn-copy .modal-uses-list {
  margin-top: 0.15rem;
}

.atom-deck-drawn-copy .modal-uses-list li {
  font-size: clamp(0.78rem, 1.25vw, 0.92rem);
}

.atom-deck-drawn-copy .hub-uses-prompt,
.atom-deck-drawn-copy .hub-life-prompt,
.atom-deck-drawn-copy .hub-compound-prompt {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(0.78rem, 1.2vw, 0.9rem);
  color: rgba(255, 255, 255, 0.72);
}

.atom-deck-drawn-copy .hub-rare-earth-note {
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(248, 187, 208, 0.35);
  background: rgba(248, 187, 208, 0.1);
  color: #ffe4f0;
}

.atom-deck-drawn-copy .hub-uses-meta {
  margin: 0.15rem 0 0.4rem;
  font-size: clamp(0.72rem, 1.1vw, 0.82rem);
  letter-spacing: 0.04em;
  text-transform: capitalize;
  color: rgba(255, 255, 255, 0.58);
}

.atom-deck-drawn-copy .hub-uses-source {
  margin: 0.45rem 0 0;
  font-size: clamp(0.68rem, 1.05vw, 0.78rem);
  color: rgba(255, 255, 255, 0.5);
}

.atom-deck-drawn-copy .modal-card:last-child {
  margin-bottom: 0;
}

@keyframes atom-deck-draw {
  from {
    opacity: 0.2;
    transform: translateY(-0.8rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atom-deck-drawn-card.is-drawing {
    animation: none;
  }

  .atom-deck-card {
    transition: border-color 160ms ease, background 160ms ease;
  }
}

.atom-diagram--hub {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  --shape-drawer-w: clamp(11rem, 38%, 22.5rem);
}

.atom-diagram--hub .atom-structure-title {
  text-align: center;
}

.atom-diagram--hub .atom-visual-card {
  border: 0;
  background: transparent;
}

.atom-visual-card--shells3d {
  position: relative;
  overflow: hidden;
}

/* Labels use the same left slide-over as the compounds list. */
.shape-info-dock {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: auto;
  pointer-events: none;
}

.shape-info-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.shape-info-scrim[hidden] {
  display: none !important;
}

.shape-info-dock.is-open .shape-info-scrim {
  pointer-events: auto;
}

.shape-info-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2;
  width: min(22.5rem, 86vw);
  margin: 0;
  padding: 0.85rem 0.9rem 1rem;
  overflow: auto;
  border-radius: 0 14px 14px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 0;
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.97), rgba(12, 16, 26, 0.98));
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.45);
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.22, 0.82, 0.24, 1);
  pointer-events: none;
}

.shape-info-dock.is-open .shape-info-drawer {
  transform: translateX(0);
  pointer-events: auto;
}

/* Info stays beside the atom. Closing it returns the atom to the full diagram. */
.atom-diagram--hub:has(> .shape-info-dock.is-open) {
  display: grid;
  grid-template-columns: var(--shape-drawer-w) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}

.atom-diagram--hub:has(> .shape-info-dock.is-open) > .atom-structure-title {
  grid-column: 1 / -1;
  grid-row: 1;
}

.atom-diagram--hub:has(> .shape-info-dock.is-open) > .atom-visual-slot {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.atom-diagram--hub:has(> .shape-info-dock.is-open) > .shape-info-dock {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 2;
  width: auto;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.atom-diagram--hub:has(> .shape-info-dock.is-open) .shape-info-drawer {
  inset: 0;
  width: auto;
  height: auto;
  transform: none;
}

.atom-diagram--hub:has(> .shape-info-dock.is-open) .shape-info-scrim {
  display: none !important;
}

.atom-diagram--hub:has(> .shape-info-dock.is-open) .shape-info-tab {
  left: calc(100% - 1px);
  right: auto;
  transform: translateY(-50%);
}

.shape-info-tab {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 2.15rem;
  min-height: 11.5rem;
  margin: 0;
  padding: 0.65rem 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: rgba(28, 36, 52, 0.92);
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.35);
  transition:
    left 0.28s cubic-bezier(0.22, 0.82, 0.24, 1),
    background 0.16s ease;
}

.shape-info-tab-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: 1;
}

.shape-info-tab:hover,
.shape-info-tab:focus-visible {
  background: rgba(50, 70, 110, 0.95);
  outline: none;
}

.shape-info-dock.is-open .shape-info-tab {
  left: min(22.5rem, 86vw);
}

@media (max-width: 560px) {
  .atom-diagram--hub:has(> .shape-info-dock.is-open) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(8rem, 42%) minmax(0, 1fr);
  }

  .atom-diagram--hub:has(> .shape-info-dock.is-open) > .shape-info-dock {
    grid-column: 1;
    grid-row: 2;
  }

  .atom-diagram--hub:has(> .shape-info-dock.is-open) > .atom-visual-slot {
    grid-column: 1;
    grid-row: 3;
  }

  .atom-diagram--hub:has(> .shape-info-dock.is-open) .shape-info-tab {
    top: auto;
    right: 0.45rem;
    bottom: 0;
    left: auto;
    flex-direction: row;
    width: auto;
    min-width: 5.5rem;
    min-height: 2.05rem;
    height: 2.05rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    transform: translateY(50%);
  }

  .atom-diagram--hub:has(> .shape-info-dock.is-open) .shape-info-tab-label {
    writing-mode: horizontal-tb;
    transform: none;
  }
}

.shape-info-dock.is-open .atom-hub-info-tab-chevron {
  transform: rotate(135deg);
}

.shape-info-drawer .atom-legend-card {
  border: 0;
  background: transparent;
  padding: 0;
}

.atom-info-note-lead {
  margin: 0.85rem 0 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.48);
}

p.atom-info-note {
  margin: 0.55rem 0 0;
  padding: 0 0.7rem;
  font-size: clamp(0.88rem, 1.35vw, 1rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

button.atom-info-note {
  display: block;
  width: 100%;
  margin: 0.4rem 0 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: clamp(0.88rem, 1.35vw, 1rem);
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

button.atom-info-note:hover,
button.atom-info-note:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

button.atom-info-note.is-active {
  background: rgba(120, 170, 255, 0.16);
  border-color: rgba(170, 205, 255, 0.45);
  color: #fff;
}

.shape-info-drawer .hub-bond-legend {
  padding-bottom: 0;
}

.atom-shells-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  touch-action: none;
}

.atom-shells-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.atom-shells-canvas.is-shell-dragging {
  cursor: grabbing;
}

.atom-visual-card--shells3d:has(.is-presenter-board) .atom-nucleus-hit-btn {
  display: none;
}

.atom-nucleus-hit-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: clamp(1.6rem, 12%, 3.2rem);
  height: clamp(1.6rem, 12%, 3.2rem);
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.atom-nucleus-hit-btn:focus {
  outline: none;
}

.atom-nucleus-hit-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.atom-diagram--hub .atom-legend-card {
  background: rgba(255, 255, 255, 0.04);
}

.modal-header-heading {
  /* Match Lucide hit targets to the element name’s line box */
  --name-line: calc(1.05 * clamp(1.75rem, 3vw, 2.75rem));
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  min-width: 0;
  flex-shrink: 0;
  overflow: visible;
}

.modal-header-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}

.modal-header-shell {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  max-width: 100%;
}

/* Icon tray beside the family / category tag — hug the icons, no chrome */
.modal-deck-card {
  flex: 0 1 auto;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  min-height: var(--name-line);
  box-sizing: border-box;
  overflow: visible;
}

.modal-name-text {
  margin: 0;
  flex-shrink: 0;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  white-space: nowrap;
}

.modal-name-sep {
  flex-shrink: 0;
  width: 3px;
  height: clamp(1.65rem, 2.9vw, 2.6rem);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.42);
}

.modal-element-state,
.modal-element-shells {
  flex-shrink: 0;
  padding: 0.1rem 0.55rem;
  font-size: clamp(0.88rem, 1.5vw, 1.38rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

.modal-element-category {
  min-width: 0;
  padding-left: 0.15rem;
  font-size: clamp(0.88rem, 1.5vw, 1.38rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fact-row {
  position: relative;
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.fact-deck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: fit-content;
  max-width: 100%;
}

.modal-about-facts {
  position: relative;
  margin-bottom: 0.55rem;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  padding-right: min(22rem, 62%);
  overflow: visible;
}

.fact-card {
  --fact-color: #90caf9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(1.65rem, 3.6vw, 2rem);
  height: clamp(1.65rem, 3.6vw, 2rem);
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fact-color);
  box-shadow: none;
  cursor: default;
  outline: none;
  transform: none;
}

.fact-card svg,
.fact-card i {
  display: block;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  color: inherit;
  stroke: currentColor;
  pointer-events: none;
}

.fact-card:hover,
.fact-card:focus-visible {
  color: color-mix(in srgb, var(--fact-color) 88%, white);
}

.fact-hover-card {
  position: absolute;
  left: 100%;
  top: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  margin-left: 0.65rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.fact-hover-name {
  display: inline-block;
  max-width: none;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(22, 24, 30, 0.96);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 140ms ease;
}

.fact-hover-card.is-on .fact-hover-name {
  opacity: 1;
  visibility: visible;
}

.modal-summary {
  margin: 0;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font-size: clamp(0.88rem, 1.15vw, 1.05rem);
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

/* ── Body grid ── */
.modal-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(8rem, 15%) 1fr minmax(11rem, 26%);
  gap: clamp(0.5rem, 1vw, 1.1rem);
  padding: clamp(0.5rem, 0.9vw, 0.85rem) 0;
  overflow: hidden;
}

.modal-sidebar {
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 0.8vw, 0.7rem);
  min-height: 0;
  overflow: hidden;
}

.modal-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: clamp(0.4rem, 0.75vw, 0.65rem);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.modal-sidebar-left .modal-panel {
  flex: 1 1 0;
}

.modal-sidebar-left .modal-human {
  flex: 0 0 auto;
}

.modal-panel-title {
  margin: 0 0 0.3rem;
  flex-shrink: 0;
  font-size: clamp(0.58rem, 0.75vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.modal-list {
  margin: 0;
  padding-left: 1.1em;
  font-size: clamp(0.68rem, 0.85vw, 0.82rem);
  line-height: 1.4;
}

.modal-list li + li {
  margin-top: 0.15em;
}

.modal-human-value {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 700;
}

.modal-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: clamp(0.5rem, 0.9vw, 0.85rem);
  background: rgba(255, 255, 255, 0.04);
}

.modal-about-title {
  margin: 0 0 0.4rem;
  flex-shrink: 0;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-about-copy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-about {
  margin: 0;
  font-size: clamp(0.74rem, 0.9vw, 0.88rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}

.modal-about-copy .modal-about + .modal-about {
  margin-top: 0;
}

.modal-secret-text {
  margin: 0;
  font-size: clamp(0.68rem, 0.82vw, 0.8rem);
  line-height: 1.45;
}

/* ── Clamp / more… expand (modal only — category gap has its own styles) ── */
.element-modal-glass [data-clamp-body] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.element-modal-glass [data-clamp].is-truncated [data-clamp-body] {
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

.element-modal-glass .clamp-more {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: clamp(0.68rem, 0.8vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.element-modal-glass .clamp-more:hover,
.element-modal-glass .clamp-more:focus-visible {
  color: #fff;
  outline: none;
}

.element-modal-glass [data-clamp].is-expanded {
  position: absolute;
  z-index: 40;
  inset: 0.35rem;
  max-height: none;
  padding: clamp(0.65rem, 1.1vw, 1rem);
  background: rgba(16, 16, 18, 0.98);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.element-modal-glass [data-clamp].is-expanded [data-clamp-body] {
  mask-image: none;
  -webkit-mask-image: none;
}

.element-modal-glass .modal-header-main[data-clamp].is-expanded {
  inset: 0.35rem;
  height: auto;
  max-height: none;
  background: rgba(16, 16, 18, 0.98);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ── Animated atom ── */
.atom-diagram {
  --el-electron: #ec407a;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  overflow: hidden;
}

.atom-structure-title {
  margin: 0;
  flex-shrink: 0;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.62);
}

/* Fills leftover space; card becomes min(slot width, slot height) */
.atom-visual-slot {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
  container-type: size;
  container-name: atom-slot;
  overflow: hidden;
}

.atom-visual-card,
.atom-legend-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.atom-visual-card {
  box-sizing: border-box;
  /* CSS fallback: largest square in the slot at any breakpoint */
  width: min(100cqw, 100cqh);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  padding: clamp(0.3rem, 2.5cqmin, 0.55rem);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  position: relative;
}

.atom-svg {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}

.atom-shell-ring {
  stroke: var(--orbit-line, #00f0ff);
  stroke-width: 1;
  stroke-opacity: 0.95;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 0.7px color-mix(in srgb, var(--orbit-line, #00f0ff) 70%, transparent));
}

.atom-shell {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: atom-orbit var(--orbit-duration, 8s) linear infinite;
}

.atom-shell--reverse {
  animation-direction: reverse;
}

.atom-electron {
  fill: var(--el-electron);
  filter: drop-shadow(0 0 var(--electron-glow, 2.5px) color-mix(in srgb, var(--el-electron) 70%, transparent));
}

.atom-nucleus-hit {
  cursor: pointer;
}

.atom-nucleus {
  /* Fill comes from layered SVG gradients (modern 3D sphere). */
  cursor: pointer;
}

.atom-nucleus-shadow,
.atom-nucleus-gloss {
  pointer-events: none;
}

.atom-nucleus-gloss {
  pointer-events: none;
}

.atom-nucleus-hit:focus {
  outline: none;
}

.atom-nucleus-hit:focus-visible .atom-nucleus {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.5;
}

.atom-electron-sign {
  fill: #fff;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 0.35;
  paint-order: stroke fill;
  font-weight: 800;
  pointer-events: none;
  user-select: none;
}

.atom-nucleus-hint {
  flex-shrink: 0;
  margin: 0.25rem 0 0;
  text-align: center;
  font-size: clamp(0.88rem, 1.45vw, 1.05rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
}

.legend-dot-proton {
  background: radial-gradient(circle at 34% 30%, #d46552, #c4452d 64%, #6e2418 100%);
  box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.35);
}

.legend-plus {
  font-size: 0.65rem;
  font-weight: 700;
  color: #f3c4bc;
  margin: 0 -0.1rem;
}

.legend-minus,
.legend-zero {
  font-size: 0.7rem;
  font-weight: 700;
  margin: 0 -0.05rem;
}

.legend-minus {
  color: color-mix(in srgb, var(--el-electron) 70%, #fff);
}

.legend-zero {
  color: rgba(255, 255, 255, 0.7);
}

.nucleus-explore {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 0.65rem 0.8rem;
  border-radius: inherit;
  background: rgba(8, 8, 10, 0.94);
  color: #f0f0f0;
}

.nucleus-explore[hidden] {
  display: none !important;
}

.nucleus-explore-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #f0f0f0;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.nucleus-explore-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.nucleus-explore-lede,
.nucleus-explore-sample {
  margin: 0;
  max-width: 18rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.7);
}

.nucleus-sphere-stage {
  margin: 0.2rem 0;
}

.nucleus-sphere {
  --nucleus-fill: #9ea5ae;
  position: relative;
  width: min(42vmin, 16.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  /* Soft specular only — no hard white oval */
  background:
    radial-gradient(ellipse 42% 34% at 30% 26%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.07) 38%, transparent 72%),
    radial-gradient(circle at 78% 72%, rgba(210, 222, 236, 0.16) 0%, transparent 42%),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.22) 82%, rgba(0, 0, 0, 0.48) 100%),
    radial-gradient(circle at 34% 30%, #d6d8e0 0%, #b0b7c0 22%, var(--nucleus-fill) 48%, #6e747d 78%, #2f3238 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset -0.55rem -0.7rem 1.4rem rgba(0, 0, 0, 0.45),
    0 1.1rem 2.4rem rgba(0, 0, 0, 0.55),
    0 0.25rem 0.6rem rgba(0, 0, 0, 0.35);
}

.nucleus-sphere::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 48% 38% at 30% 26%, rgba(255, 255, 255, 0.07), transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nucleus-sphere-core {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.nucleon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--nucleon, 0.85rem);
  height: var(--nucleon, 0.85rem);
  margin: calc(var(--nucleon, 0.85rem) / -2) 0 0 calc(var(--nucleon, 0.85rem) / -2);
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: calc(var(--nucleon, 0.85rem) * 0.55);
  font-weight: 800;
  line-height: 1;
  transform: translate(var(--x), var(--y));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.nucleon-p {
  background: #c4452d;
  color: #fff6f4;
}

.nucleon-n {
  background: #6b727b;
  color: #f2f4f6;
}

.nucleon-key {
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
}

.nucleus-explore-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
}

.nucleus-explore-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@keyframes atom-orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atom-shell {
    animation: none;
  }
}

.atom-legend-card {
  flex-shrink: 0;
  width: 100%;
  padding: 0.45rem 0.6rem;
}

.modal-sidebar-right .modal-secret {
  flex: 0 1 32%;
  min-height: 0;
  max-height: 38%;
}

.atom-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: clamp(0.88rem, 1.45vw, 1.05rem);
  line-height: 1.45;
}

.atom-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

button.atom-legend-hit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.12rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

button.atom-legend-hit:hover,
button.atom-legend-hit:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

button.atom-legend-hit.is-active {
  background: rgba(120, 170, 255, 0.16);
  border-color: rgba(170, 205, 255, 0.45);
}

.atom-legend li:not(:last-child)::after {
  content: '|';
  margin-left: 0.5rem;
  color: rgba(255, 255, 255, 0.35);
}

.legend-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot-electron {
  background: var(--el-electron);
}

.legend-dot-proton {
  background: radial-gradient(circle at 34% 30%, #d46552, #c4452d 64%, #6e2418 100%);
  box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.35);
}

.legend-plus {
  font-size: 0.65rem;
  font-weight: 700;
  color: #f3c4bc;
  margin: 0 -0.1rem;
}

.legend-dot-neutron {
  background: radial-gradient(circle at 34% 30%, #8d949c, #6b727b 64%, #3a4046 100%);
  box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.35);
}

.atom-isotope {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Uses footer ── */
.modal-uses {
  flex-shrink: 0;
  max-height: 18%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: clamp(0.4rem, 0.8vw, 0.65rem);
}

.modal-uses-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.modal-uses-list li {
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: clamp(0.64rem, 0.78vw, 0.74rem);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  text-transform: capitalize;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-scale-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 900px) {
  .atom-hub {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 38%) minmax(12rem, 62%);
  }

  .modal-deck-card {
    flex: 1 1 100%;
    margin-left: 0;
  }
}

/*
 * Structure / Isotopes — drawer layout (class set in JS for ≤900px / narrow hubs):
 * Compounds and Uses always use it. The panel sits beside the view while open
 * and slides away so the view can use the full hub.
 */
.atom-hub.has-hub-visual.is-drawer-layout {
  --hub-drawer-panel: clamp(11rem, 34%, 22.5rem);
  position: relative;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
}

.atom-hub.has-hub-visual.is-drawer-layout .atom-hub-atom {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  width: 100%;
  height: 100% !important;
  min-height: min(62vh, 22rem);
  transition:
    margin-left 0.28s cubic-bezier(0.22, 0.82, 0.24, 1),
    left 0.28s cubic-bezier(0.22, 0.82, 0.24, 1),
    width 0.28s cubic-bezier(0.22, 0.82, 0.24, 1);
}

.atom-hub.has-hub-visual.is-drawer-layout .atom-hub-visual,
.atom-hub.has-hub-visual.is-drawer-layout .hub-bond-visual,
.atom-hub.has-hub-visual.is-drawer-layout .hub-structure-stage,
.atom-hub.has-hub-visual.is-drawer-layout .hub-life-stage,
.atom-hub.has-hub-visual.is-drawer-layout .hub-lab-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.atom-hub.has-hub-visual.is-drawer-layout .hub-structure-viewport {
  --structure-box: 100%;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.atom-hub.has-hub-visual.is-drawer-layout .hub-structure-stage.is-bond-molecule {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 0;
}

.atom-hub.has-hub-visual.is-drawer-layout .hub-structure-stage.is-bond-molecule .hub-structure-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  max-width: none;
  max-height: none;
  border-radius: 0;
  z-index: 1;
}

/* Compounds (and the atom) use the card, climbing only into the empty header gap. */
.atom-hub.has-hub-visual.has-bond-molecule,
.atom-hub.has-hub-visual.is-drawer-layout.has-bond-molecule {
  position: relative;
  overflow: visible;
}

.atom-hub.has-hub-visual.has-bond-molecule .atom-hub-atom,
.atom-hub.has-hub-visual.is-drawer-layout.has-bond-molecule .atom-hub-atom {
  position: absolute;
  left: 0;
  right: 0;
  top: -1.5rem;
  bottom: 0;
  width: auto;
  height: auto !important;
  min-height: 0;
  z-index: 1;
}

.atom-hub.has-hub-visual.is-drawer-layout .hub-life-viewport {
  --life-box: min(100cqw, 100cqh, 86vmin, 32rem);
}

.atom-hub.has-hub-visual.is-drawer-layout .hub-life-viewport.has-dna {
  width: min(100%, calc(var(--life-box) * 1.92));
  height: var(--life-box);
  max-width: 100%;
}

.atom-hub.has-hub-visual.is-drawer-layout .atom-deck {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--hub-drawer-panel);
  height: 100%;
  max-height: none;
  z-index: 8;
  padding: 0.65rem 0.7rem 0.85rem;
  border-radius: 0 14px 14px 0;
  background:
    linear-gradient(180deg, rgba(18, 24, 36, 0.97), rgba(12, 16, 26, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 0;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.45);
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.22, 0.82, 0.24, 1);
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-deck {
  transform: translateX(0);
  pointer-events: auto;
}

/* Uses: the blue card is the drawer. No second shell around it. */
.atom-hub.has-hub-visual.has-uses-gallery.is-drawer-layout .atom-deck {
  top: 0;
  bottom: auto;
  height: auto;
  max-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.atom-hub.has-hub-visual.has-uses-gallery.is-drawer-layout .atom-deck-drawn {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
}

.atom-hub.has-hub-visual.has-uses-gallery.is-drawer-layout .atom-deck-drawn-card {
  flex: 1 1 auto;
  height: auto;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  background: rgba(14, 20, 34, 0.84);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.atom-hub.has-hub-visual.has-uses-gallery.is-drawer-layout .atom-deck-drawn-body {
  min-height: 0;
  overflow: hidden;
}

.atom-hub.has-hub-visual.has-uses-gallery.is-drawer-layout .atom-deck-drawn-copy {
  overflow-y: auto;
}

.atom-hub.has-hub-visual.is-drawer-layout .atom-hub-info-tab {
  display: flex;
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 9;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 2.15rem;
  min-height: 11.5rem;
  padding: 0.65rem 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: rgba(28, 36, 52, 0.92);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.35);
  transition:
    left 0.28s cubic-bezier(0.22, 0.82, 0.24, 1),
    background 0.16s ease;
}

.atom-hub.has-hub-visual.is-drawer-layout .atom-hub-info-tab:hover,
.atom-hub.has-hub-visual.is-drawer-layout .atom-hub-info-tab:focus-visible {
  background: rgba(50, 70, 110, 0.95);
  outline: none;
}

.atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-hub-info-tab {
  left: calc(var(--hub-drawer-panel) - 1px);
}

/* Open drawer reserves its own column so the view beside it stays visible. */
.atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-hub-atom {
  width: calc(100% - var(--hub-drawer-panel));
  margin-left: var(--hub-drawer-panel);
  min-width: 0;
}

.atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open.has-bond-molecule .atom-hub-atom {
  margin-left: 0;
  left: var(--hub-drawer-panel);
  right: 0;
  width: auto;
}

.atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-hub-info-scrim {
  display: none !important;
}

.atom-hub-info-tab-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: 1;
}

.atom-hub-info-tab-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.85;
}

.atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-hub-info-tab-chevron {
  transform: rotate(135deg);
}

.atom-hub.has-hub-visual.is-drawer-layout .atom-hub-info-scrim {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 7;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.atom-hub.has-hub-visual.is-drawer-layout .atom-hub-info-scrim[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .atom-hub.has-hub-visual.is-drawer-layout .atom-deck,
  .atom-hub.has-hub-visual.is-drawer-layout .atom-hub-atom,
  .atom-hub.has-hub-visual.is-drawer-layout .atom-hub-info-tab,
  .shape-info-drawer,
  .shape-info-tab {
    transition: none;
  }
}

/* Narrow window: stack the open drawer above the view so neither is covered. */
@media (max-width: 560px) {
  .atom-hub.has-hub-visual.is-drawer-layout {
    --hub-drawer-panel: 100%;
  }

  .atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open {
    display: flex;
    flex-direction: column;
  }

  .atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-deck {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    flex: 0 1 46%;
    width: 100%;
    height: auto;
    max-height: 46%;
    transform: none;
    pointer-events: auto;
    border-radius: 0 0 14px 14px;
  }

  .atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-hub-atom,
  .atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open.has-bond-molecule .atom-hub-atom {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    flex: 1 1 auto;
    width: 100%;
    height: auto !important;
    min-height: 0;
    margin-left: 0;
  }

  .atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-hub-info-tab {
    left: auto !important;
    right: 0.45rem !important;
    top: auto !important;
    bottom: calc(54% - 0.15rem) !important;
    flex-direction: row;
    width: auto;
    min-width: 5.5rem;
    min-height: 2.05rem;
    height: 2.05rem;
    padding: 0.25rem 0.7rem;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    transform: translateY(50%) !important;
  }

  .atom-hub.has-hub-visual.is-drawer-layout.is-info-drawer-open .atom-hub-info-tab-label {
    writing-mode: horizontal-tb;
    transform: none;
  }
}

@media (max-width: 720px) {
  .modal-body {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(12rem, 1.2fr) minmax(0, 1.15fr);
    overflow: hidden;
  }

  .modal-body.modal-body-atom {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  .modal-sidebar-left {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
  }

  .modal-sidebar-right {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
  }

  .modal-main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .modal-sidebar-right .modal-secret {
    flex: 0 1 auto;
    max-height: 4.25rem;
  }

  .modal-header {
    --header-square: clamp(4rem, 18vw, 6rem);
    gap: 0.55rem;
  }

  .modal-header-main {
    padding-right: 0.5rem;
  }
}

/* Term + (i) are one inline unit. (i) is a span, not a nested button. */
.acronym {
  display: inline;
  white-space: nowrap;
}

.acronym-info {
  display: inline-block;
  box-sizing: border-box;
  width: 1rem;
  height: 1rem;
  margin-left: 0.15em;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(248, 187, 208, 0.65);
  background: rgba(240, 98, 146, 0.18);
  color: #f8bbd0;
  font-family: inherit;
  font-size: 0.68rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
  cursor: pointer;
  vertical-align: 0.12em;
}

.acronym-info:hover,
.acronym-info:focus-visible {
  background: rgba(240, 98, 146, 0.35);
  outline: none;
}

.element-modal-root.has-acronym-dialog .element-modal-backdrop,
.element-modal-root.has-acronym-dialog .element-modal-close {
  pointer-events: none;
}

.acronym-dialog {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: auto;
}

.acronym-dialog[hidden] {
  display: none !important;
}

.acronym-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 18, 0.55);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

.acronym-dialog-card {
  position: relative;
  z-index: 1;
  width: min(22rem, 100%);
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(160deg, rgba(36, 28, 48, 0.98), rgba(18, 22, 36, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  color: #f5f7ff;
}

.acronym-dialog-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.acronym-dialog-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.acronym-dialog-term {
  margin: 0 1.5rem 0.15rem 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8bbd0;
}

.acronym-dialog-expand {
  margin: 0 1.5rem 0.55rem 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.acronym-dialog-body {
  margin: 0;
  font-size: clamp(0.92rem, 1.5vw, 1.05rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 520px) {
  .modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.9fr) minmax(0, 1fr) minmax(10rem, 1.1fr);
  }

  .modal-body.modal-body-atom {
    grid-template-rows: minmax(0, 1fr);
  }

  .modal-sidebar-left,
  .modal-sidebar-right,
  .modal-main {
    grid-column: 1;
  }

  .modal-sidebar-left {
    grid-row: 1;
  }

  .modal-main {
    grid-row: 2;
  }

  .modal-sidebar-right {
    grid-row: 3;
  }

  .atom-hub {
    overflow: auto;
    grid-template-rows: minmax(0, 35%) minmax(0, 65%);
  }
}

/* Screens smaller than an iPad: the element opens as the atom only. */
.element-modal-root.is-atom-only .element-modal-glass {
  border: 0;
  border-radius: 0;
  background: #0b0b0b;
  box-shadow: none;
}

.element-modal-root.is-atom-only .element-modal-accent {
  display: none;
}

.element-modal-root.is-atom-only .element-modal-inner {
  padding: 0;
}

.element-modal-root.is-atom-only .atom-only-name {
  position: absolute;
  z-index: 5;
  top: max(0.7rem, env(safe-area-inset-top));
  left: max(0.8rem, env(safe-area-inset-left));
  margin: 0;
  max-width: calc(100% - 4.5rem);
  font-size: clamp(1.05rem, 4.2vw, 1.45rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #f4f4f4;
  pointer-events: none;
}

.element-modal-root.is-atom-only .element-modal-close {
  z-index: 30;
  top: max(0.55rem, env(safe-area-inset-top));
  right: max(0.55rem, env(safe-area-inset-right));
}

.element-modal-root.is-atom-only .modal-body {
  display: flex;
  height: 100%;
  padding: 0;
}

.element-modal-root.is-atom-only .atom-hub {
  display: flex;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: none;
  grid-template-rows: none;
}

.element-modal-root.is-atom-only .atom-hub-atom,
.element-modal-root.is-atom-only .atom-hub-atom-main,
.element-modal-root.is-atom-only .atom-diagram,
.element-modal-root.is-atom-only .atom-visual-slot,
.element-modal-root.is-atom-only .atom-visual-card {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  overflow: visible;
}
