:root {
  color-scheme: light;
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --surface-blue: #eff6f7;
  --ink: #13232c;
  --muted: #66747c;
  --line: #d8d7d0;
  --line-dark: #b9c1c4;
  --blue: #176b87;
  --blue-deep: #16495c;
  --cyan: #65c6d1;
  --gold: #bb8730;
  --red: #ac5046;
  --green: #3b755a;
  --purple: #745a8d;
  --s-block: #dbeef1;
  --p-block: #f2e6cc;
  --d-block: #e8dfe9;
  --f-block: #dce7da;
  --max-width: 1220px;
  --radius: 2px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Noto Sans KR", system-ui, sans-serif;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 86% 8%, rgb(23 107 135 / 9%), transparent 27rem),
    var(--paper);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(23 107 135 / 34%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 13px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.intro {
  padding: 32px 0 64px;
  border-bottom: 1px solid var(--line);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.crumbs a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr);
  gap: clamp(42px, 8vw, 112px);
  align-items: end;
  padding-top: 62px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-family: "Newsreader", "Noto Serif KR", Georgia, serif;
  font-size: clamp(45px, 7.4vw, 88px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .98;
}

.intro-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.intro-copy p {
  margin: 0;
}

.intro-copy .scope-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.7;
}

main.page-shell {
  padding-top: 52px;
  padding-bottom: 92px;
}

.control-panel {
  position: relative;
  z-index: 5;
  margin-bottom: 22px;
  padding: 26px;
  border: 1px solid #aabfc6;
  border-radius: var(--radius);
  background: #edf5f6;
  box-shadow: 0 15px 50px rgb(19 35 44 / 6%);
}

.control-heading,
.control-row,
.section-heading,
.story-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.control-heading h2,
.section-heading h2,
.story-heading h2,
.method-section h2 {
  margin: 0;
  font-family: "Newsreader", "Noto Serif KR", Georgia, serif;
  font-size: clamp(27px, 3.2vw, 40px);
  font-weight: 400;
  letter-spacing: -.035em;
}

.control-meta {
  display: flex;
  align-items: center;
  gap: 22px;
}

#atomic-number-output {
  min-width: 88px;
  color: var(--blue-deep);
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  text-align: right;
}

.model-switch {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid #bdd0d5;
  background: rgb(255 255 255 / 65%);
}

.model-switch > span {
  padding: 0 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.mode-button {
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.mode-button[aria-pressed="true"] {
  background: var(--blue-deep);
  color: white;
}

.control-row {
  align-items: end;
  margin-top: 26px;
}

.button-group {
  display: flex;
  flex: none;
  gap: 7px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid var(--blue-deep);
  cursor: pointer;
  font-size: 12px;
}

.button-primary {
  min-width: 116px;
  background: var(--blue-deep);
  color: white;
}

.button-secondary {
  background: transparent;
  color: var(--blue-deep);
}

.button:hover {
  filter: brightness(.96);
}

.range-field {
  display: grid;
  flex: 1;
  gap: 7px;
  min-width: 0;
  cursor: pointer;
}

.range-label,
.range-ends {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.range-label {
  color: var(--muted);
  font-size: 11px;
}

.range-label strong {
  color: var(--ink);
  font-size: 13px;
}

.range-ends {
  color: #70838a;
  font-size: 9.5px;
}

input[type="range"] {
  width: 100%;
  min-height: 26px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.catalog-status {
  margin-bottom: 18px;
  padding: 10px 13px;
  border-left: 3px solid var(--gold);
  background: #fff8e8;
  color: #6f572f;
  font-size: 12px;
}

.catalog-status.is-ready {
  display: none;
}

.catalog-status.is-error {
  border-color: var(--red);
  background: #fff0ed;
  color: #7b3731;
}

.view-panel {
  margin-bottom: 0;
  padding: clamp(24px, 3.4vw, 38px);
  border: 1px solid #afbec1;
  background: #17313c;
  color: white;
}

.view-panel-heading {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(520px, 1.28fr);
  align-items: end;
  gap: clamp(28px, 5vw, 70px);
}

.view-panel .section-kicker {
  color: #7bd0d8;
}

.view-panel h2 {
  margin: 0;
  font-family: "Newsreader", "Noto Serif KR", Georgia, serif;
  font-size: clamp(27px, 3.2vw, 40px);
  font-weight: 400;
  letter-spacing: -.035em;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgb(255 255 255 / 23%);
}

.view-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid rgb(255 255 255 / 18%);
  background: transparent;
  color: rgb(255 255 255 / 66%);
  cursor: pointer;
  font-size: 12px;
}

.view-button:last-child {
  border-right: 0;
}

.view-button span {
  color: #7bd0d8;
  font-size: 9px;
  letter-spacing: .08em;
}

.view-button[aria-pressed="true"] {
  background: #f1bc60;
  color: #142d38;
  font-weight: 700;
}

.view-button[aria-pressed="true"] span {
  color: #72521d;
}

.metric-controls {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px solid rgb(255 255 255 / 16%);
}

.metric-controls[hidden] {
  display: none;
}

.metric-controls p {
  margin: 0;
  color: rgb(255 255 255 / 58%);
  font-size: 10px;
  letter-spacing: .08em;
}

.metric-button-row {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 6px;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.metric-button-row button {
  flex: none;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid rgb(255 255 255 / 25%);
  background: transparent;
  color: rgb(255 255 255 / 76%);
  cursor: pointer;
  font-size: 10.5px;
  white-space: nowrap;
}

.metric-button-row button[aria-pressed="true"] {
  border-color: #7bd0d8;
  background: rgb(123 208 216 / 15%);
  color: white;
}

.view-context {
  margin: 19px 0 0;
  color: rgb(255 255 255 / 61%);
  font-size: 10.5px;
  line-height: 1.7;
}

.context-badge {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 10px;
  line-height: 1.45;
  text-align: right;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 13px;
  padding: 14px 16px;
  border: 1px solid #d2dedf;
  background: #f4f8f8;
  color: var(--muted);
  font-size: 9.5px;
}

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

.legend-gradient {
  width: min(330px, 48vw);
  height: 12px;
  border: 1px solid rgb(19 35 44 / 13%);
  background: linear-gradient(90deg, #e8f4f5, #aad7dd, #57aebc, #24788f, #153f56);
}

.legend-scale {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-scale strong {
  min-width: 64px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-item i,
.legend-missing i {
  width: 11px;
  height: 11px;
  border: 1px solid rgb(19 35 44 / 14%);
  background: var(--legend-color, #d9dedd);
}

.legend-missing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.trend-selected {
  min-height: 20px;
  margin: 0 0 11px;
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 650;
}

body[data-view-mode="properties"] .atom-visual,
body[data-view-mode="industry"] .atom-visual,
body[data-view-mode="properties"] .energy-section,
body[data-view-mode="industry"] .energy-section,
body[data-view-mode="properties"] .model-switch,
body[data-view-mode="industry"] .model-switch {
  display: none;
}

body[data-view-mode="properties"] .atom-layout,
body[data-view-mode="industry"] .atom-layout {
  grid-template-columns: 1fr;
  min-height: 0;
}

.atom-layout {
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(380px, 1.05fr);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.atom-visual {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 34px 24px 28px;
  background:
    linear-gradient(rgb(255 255 255 / 2%), transparent),
    #153846;
}

#atom-svg {
  display: block;
  width: min(100%, 470px);
  height: auto;
  overflow: visible;
}

.shell-layer circle {
  fill: none;
  stroke: rgb(225 244 247 / 24%);
  stroke-width: 1;
}

.shell-layer circle.is-active {
  stroke: rgb(225 244 247 / 56%);
}

.electron {
  fill: var(--cyan);
  filter: drop-shadow(0 0 5px rgb(101 198 209 / 85%));
}

.electron.is-valence {
  fill: #f2bd60;
  filter: drop-shadow(0 0 6px rgb(242 189 96 / 90%));
}

.nucleus circle {
  fill: #f3bd62;
  stroke: rgb(255 255 255 / 36%);
}

.nucleus text {
  fill: #163846;
  text-anchor: middle;
}

.nucleus-symbol {
  font-family: "Newsreader", Georgia, serif;
  font-size: 21px;
  font-weight: 600;
}

.nucleus-number {
  font-size: 8px;
}

.is-hidden {
  display: none;
}

.field-ring {
  fill: none;
  stroke: rgb(255 255 255 / 9%);
}

.orbital-lobe {
  mix-blend-mode: screen;
  stroke-width: 1.3;
}

.phase-positive {
  fill: rgb(95 208 219 / 25%);
  stroke: rgb(114 220 229 / 72%);
}

.phase-negative {
  fill: rgb(220 116 102 / 23%);
  stroke: rgb(235 137 123 / 72%);
}

.density-low {
  opacity: .26;
}

.density-mid {
  opacity: .42;
}

.density-high {
  opacity: .72;
}

.angular-node {
  stroke: rgb(255 255 255 / 29%);
  stroke-dasharray: 4 6;
}

.radial-node-layer circle {
  display: none;
  fill: none;
  stroke: rgb(255 255 255 / 33%);
  stroke-dasharray: 3 7;
}

.radial-node-layer circle.is-active {
  display: block;
}

.orbital-origin {
  fill: #f3bd62;
}

.orbital-svg-label {
  fill: rgb(255 255 255 / 74%);
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
  text-anchor: middle;
}

.model-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 13px;
  margin-top: 7px;
  color: rgb(236 247 249 / 73%);
  font-size: 10.5px;
}

.model-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.inner-dot,
.phase-positive-dot {
  background: var(--cyan);
}

.valence-dot {
  background: #f2bd60;
}

.phase-negative-dot {
  background: #dc7466;
}

.legend-line {
  display: inline-block;
  width: 15px;
  border-top: 1px solid rgb(255 255 255 / 55%);
}

.legend-node {
  display: inline-block;
  width: 15px;
  border-top: 1px dashed rgb(255 255 255 / 60%);
}

.element-details {
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 62px);
}

.element-identity {
  display: grid;
  grid-template-columns: 30px 102px minmax(0, 1fr);
  align-items: center;
  padding-bottom: 31px;
  border-bottom: 1px solid var(--line);
}

.detail-number {
  align-self: start;
  padding-top: 9px;
  color: var(--blue);
  font-family: "Newsreader", Georgia, serif;
  font-size: 14px;
}

.detail-symbol {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(62px, 7vw, 90px);
  font-weight: 400;
  letter-spacing: -.06em;
  line-height: 1;
}

.element-identity h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -.035em;
}

.element-identity p {
  margin: 7px 0 0;
  color: var(--muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: 14px;
}

.fact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0;
}

.fact-list > div {
  min-width: 0;
  padding: 13px 12px 13px 0;
  border-bottom: 1px solid #eceae4;
}

.fact-list > div:nth-child(even) {
  padding-right: 0;
  padding-left: 14px;
  border-left: 1px solid #eceae4;
}

.fact-list .wide-fact {
  grid-column: span 2;
  padding-left: 0;
  border-left: 0;
}

.fact-list dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.fact-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.5;
}

.electron-change {
  margin: auto 0 0;
  padding: 16px;
  border-left: 3px solid var(--blue);
  background: var(--surface-blue);
  color: #2d4d5a;
  font-size: 12.5px;
  line-height: 1.7;
}

.electron-change span {
  display: block;
  margin-bottom: 3px;
  color: var(--blue);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.story-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 470px;
  padding: clamp(30px, 4vw, 48px);
}

.naming-card {
  border-right: 1px solid var(--line);
}

.story-heading {
  align-items: start;
}

.story-heading h2 {
  font-size: clamp(25px, 3vw, 36px);
}

.story-badge {
  flex: none;
  padding: 6px 9px;
  border: 1px solid currentColor;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

.market-commodity {
  color: #8d5725;
}

.market-industrial-gas {
  color: #176b87;
}

.market-specialty {
  color: #6c5185;
}

.market-byproduct {
  color: #876c20;
}

.market-isotope {
  color: #3e765d;
}

.market-regulated {
  color: #a4443c;
}

.market-research {
  color: #59656b;
}

.root-word {
  margin: 54px 0 17px;
  font-family: "Newsreader", "Noto Serif KR", Georgia, serif;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.3;
}

.story-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}

.story-source-note {
  width: min(100%, 420px);
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.sector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 38px 0 18px;
  padding: 0;
  list-style: none;
}

.sector-list li {
  padding: 7px 10px;
  border: 1px solid #d7dfe0;
  background: #f2f7f7;
  color: #39545e;
  font-size: 10.5px;
}

.actor-section {
  margin-top: auto;
  padding-top: 28px;
}

.actor-section h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .07em;
}

.actor-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.actor-list .actor-entry,
.actor-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-decoration: none;
}

.actor-list .actor-entry > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.actor-list b {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actor-list small {
  color: var(--muted);
  font-size: 9.5px;
}

.actor-empty {
  color: var(--muted);
  line-height: 1.55;
}

.energy-section,
.periodic-section {
  margin-top: 22px;
  padding: clamp(30px, 4.2vw, 50px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.energy-heading {
  align-items: end;
}

#energy-summary {
  color: var(--blue);
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
}

.energy-note,
.periodic-guide {
  max-width: 720px;
  margin: 15px 0 24px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.energy-scroll,
.periodic-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #9fb5bb #edf1f1;
  scrollbar-width: thin;
}

.energy-diagram {
  display: grid;
  grid-template-columns: 48px minmax(610px, 1fr);
  min-width: 700px;
  min-height: 360px;
  padding: 24px;
  border: 1px solid #d6dfe0;
  background:
    linear-gradient(rgb(255 255 255 / 82%), rgb(255 255 255 / 82%)),
    repeating-linear-gradient(0deg, transparent 0 35px, #dce5e6 36px);
}

.energy-axis {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  color: var(--muted);
  font-size: 9px;
}

.energy-axis i {
  width: 1px;
  margin: 8px 0;
  background: linear-gradient(var(--red), var(--blue));
}

.energy-levels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  padding-left: 8px;
}

.energy-row {
  display: grid;
  grid-template-columns: 42px 1fr 55px;
  align-items: center;
  min-height: 23px;
  gap: 9px;
}

.energy-row.is-active {
  color: var(--blue);
  font-weight: 700;
}

.energy-label,
.energy-count {
  font-size: 10px;
}

.energy-count {
  color: var(--muted);
  text-align: right;
}

.orbital-boxes {
  display: flex;
  align-items: center;
  gap: 4px;
}

.orbital-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 21px;
  border-bottom: 2px solid #8fa2a8;
  color: var(--blue-deep);
  font-size: 13px;
  letter-spacing: -2px;
}

.energy-row.is-active .orbital-box {
  border-color: var(--blue);
  background: #e7f4f5;
}

.energy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 10px;
}

.energy-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.orbital-box-sample {
  padding: 2px 4px;
  border-bottom: 2px solid #8fa2a8;
  color: var(--blue-deep);
  font-style: normal;
}

.block-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

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

.block-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.block-swatch {
  width: 10px;
  height: 10px;
  border: 1px solid rgb(19 35 44 / 12%);
}

.block-s {
  background: var(--s-block);
}

.block-p {
  background: var(--p-block);
}

.block-d {
  background: var(--d-block);
}

.block-f {
  background: var(--f-block);
}

.periodic-scroll {
  padding-bottom: 13px;
}

.periodic-table {
  display: grid;
  grid-template-columns: repeat(18, 54px);
  grid-template-rows: 22px repeat(7, 58px) 16px repeat(2, 58px);
  gap: 4px;
  width: max-content;
  min-width: 1040px;
}

.group-label {
  align-self: end;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.series-label {
  align-self: center;
  padding-right: 7px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.2;
  text-align: right;
}

.element-button {
  position: relative;
  display: grid;
  grid-template-rows: 12px 1fr 11px;
  min-width: 54px;
  height: 58px;
  padding: 4px;
  border: 1px solid rgb(19 35 44 / 16%);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}

.element-button[data-block="s"] {
  background: var(--s-block);
}

.element-button[data-block="p"] {
  background: var(--p-block);
}

.element-button[data-block="d"] {
  background: var(--d-block);
}

.element-button[data-block="f"] {
  background: var(--f-block);
}

.element-button[data-map-active="true"] {
  background: var(--trend-fill, #d9dedd);
  color: var(--trend-ink, var(--ink));
}

body[data-view-mode="properties"] .element-button,
body[data-view-mode="industry"] .element-button {
  grid-template-rows: 1fr;
  place-items: center;
  text-align: center;
}

body[data-view-mode="properties"] .cell-number,
body[data-view-mode="properties"] .cell-name,
body[data-view-mode="industry"] .cell-number,
body[data-view-mode="industry"] .cell-name {
  display: none;
}

body[data-view-mode="properties"] .cell-symbol,
body[data-view-mode="industry"] .cell-symbol {
  align-self: center;
  color: inherit;
  font-size: 21px;
}

.element-button:hover {
  z-index: 2;
  border-color: var(--blue);
  box-shadow: 0 6px 14px rgb(19 35 44 / 13%);
  transform: translateY(-2px);
}

.element-button[aria-pressed="true"] {
  z-index: 3;
  border: 2px solid var(--blue-deep);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--blue);
}

.cell-number {
  font-size: 7px;
}

.cell-symbol {
  align-self: center;
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  line-height: 1;
  text-align: center;
}

.cell-name {
  overflow: hidden;
  font-size: 6.5px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.method-section {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(360px, 1.3fr);
  gap: clamp(38px, 7vw, 94px);
  margin-top: 22px;
  padding: clamp(34px, 5vw, 60px);
  border: 1px solid var(--line);
  background: #172c36;
  color: white;
}

.method-section .section-kicker {
  color: #7bd0d8;
}

.method-copy {
  color: rgb(255 255 255 / 74%);
  font-size: 12px;
  line-height: 1.75;
}

.method-copy p {
  margin: 0 0 13px;
}

.method-copy .method-limit {
  padding-top: 13px;
  border-top: 1px solid rgb(255 255 255 / 15%);
  color: rgb(255 255 255 / 57%);
  font-size: 10.5px;
}

.reference-block {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgb(255 255 255 / 15%);
}

.reference-block h3 {
  margin: 0 0 8px;
  color: white;
  font-size: 12px;
}

.reference-block > p {
  color: rgb(255 255 255 / 57%);
  font-size: 10px;
}

.method-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 25px;
}

.method-sources a {
  padding: 7px 9px;
  border: 1px solid rgb(255 255 255 / 25%);
  color: rgb(255 255 255 / 82%);
  font-size: 9.5px;
  text-decoration: none;
}

.method-sources a:hover {
  border-color: #7bd0d8;
  color: #7bd0d8;
}

.organization-source-details {
  margin-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 12%);
}

.organization-source-details summary {
  padding: 13px 0;
  color: rgb(255 255 255 / 73%);
  cursor: pointer;
  font-size: 10.5px;
}

.organization-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  padding: 4px 0 8px;
}

.organization-sources a {
  overflow: hidden;
  color: rgb(255 255 255 / 62%);
  font-size: 9.5px;
  text-decoration-color: rgb(255 255 255 / 26%);
  text-overflow: ellipsis;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.organization-sources a:hover {
  color: #7bd0d8;
}

.related-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 22px;
  border: 1px solid var(--line);
}

.related-nav a {
  display: flex;
  justify-content: space-between;
  padding: 19px;
  background: rgb(255 253 248 / 66%);
  font-size: 12px;
  text-decoration: none;
}

.related-nav a:first-child {
  border-right: 1px solid var(--line);
}

.related-nav a:hover {
  background: var(--surface-blue);
}

.page-footer {
  padding: 34px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.page-footer p {
  max-width: 920px;
  margin: 0;
}

.noscript {
  margin: 0;
  padding: 16px;
  background: #fff1d6;
  color: #6b4d1c;
  text-align: center;
}

@media (max-width: 900px) {
  .intro-grid,
  .view-panel-heading,
  .atom-layout,
  .story-grid,
  .method-section {
    grid-template-columns: 1fr;
  }

  .intro-grid {
    gap: 27px;
    padding-top: 48px;
  }

  .intro-copy {
    max-width: 660px;
  }

  .control-row {
    align-items: stretch;
    flex-direction: column;
  }

  .view-panel-heading {
    align-items: start;
    gap: 22px;
  }

  .button-group {
    align-self: start;
  }

  .atom-visual {
    min-height: 520px;
  }

  .naming-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .story-card {
    min-height: 410px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(calc(100% - 26px), var(--max-width));
  }

  .intro {
    padding: 22px 0 45px;
  }

  main.page-shell {
    padding-top: 28px;
    padding-bottom: 62px;
  }

  .control-panel {
    padding: 18px;
  }

  .view-panel {
    padding: 22px 18px;
  }

  .control-heading,
  .section-heading,
  .story-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .control-meta {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  #atomic-number-output {
    text-align: left;
  }

  .model-switch {
    width: 100%;
  }

  .model-switch .mode-button {
    flex: 1;
  }

  .view-button {
    min-height: 50px;
    padding-inline: 7px;
    font-size: 10.5px;
  }

  .metric-controls {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .context-badge {
    text-align: left;
  }

  .legend-scale {
    width: 100%;
    flex-wrap: wrap;
  }

  .legend-gradient {
    order: 3;
    width: 100%;
  }

  .legend-missing {
    margin-left: 0;
  }

  .button-group {
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    width: 100%;
  }

  .button {
    min-width: 0;
    padding-inline: 7px;
  }

  .atom-layout {
    min-height: 0;
  }

  .atom-visual {
    min-height: 390px;
    padding: 16px 8px;
  }

  #atom-svg {
    width: min(100%, 390px);
  }

  .model-legend {
    max-width: 330px;
    padding-inline: 8px;
  }

  .element-details,
  .story-card,
  .energy-section,
  .periodic-section {
    padding: 26px 20px;
  }

  .element-identity {
    grid-template-columns: 25px 86px minmax(0, 1fr);
  }

  .fact-list {
    grid-template-columns: 1fr;
  }

  .fact-list > div,
  .fact-list > div:nth-child(even),
  .fact-list .wide-fact {
    grid-column: auto;
    padding-right: 0;
    padding-left: 0;
    border-left: 0;
  }

  .story-card {
    min-height: 0;
  }

  .root-word {
    margin-top: 34px;
  }

  .source-link,
  .actor-section {
    margin-top: 34px;
  }

  .energy-heading {
    align-items: flex-start;
  }

  .method-section {
    grid-template-columns: 1fr;
    padding: 32px 22px;
  }

  .organization-sources {
    grid-template-columns: 1fr;
  }

  .related-nav {
    grid-template-columns: 1fr;
  }

  .related-nav a:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
