:root {
  color-scheme: light;
  --ink: #152d43;
  --muted: #516477;
  --line: #d4dee6;
  --page: #f6f8fa;
  --white: #fff;
  --blue: #15598a;
  --active: #e1edf6;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: var(--blue); text-underline-offset: .19em; }
a:hover { color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button, select, input[type="search"] {
  border: 1px solid #a9bbc8;
  border-radius: .3rem;
  background: var(--white);
  padding: .45rem .7rem;
  min-height: 2.4rem;
}
button:hover { background: var(--active); }
select {
  appearance: none;
  padding-right: 1.8rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) center, calc(100% - 8px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  max-width: 100%;
}
:focus-visible { outline: 3px solid #006fbb; outline-offset: 3px; }
:disabled { cursor: default; opacity: .6; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.25rem); letter-spacing: -.049em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.025em; }
h3 { font-size: 1.05rem; }
p + p { margin-top: .75rem; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: .6rem; left: .6rem; padding: .6rem; z-index: 10; background: white; }
.quiet { color: var(--muted); font-size: .875rem; }
.masthead { background: var(--ink); color: white; }
.masthead-inner {
  max-width: 1500px; margin: auto; padding: .7rem clamp(1rem, 4vw, 3rem);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem;
}
.masthead a { color: inherit; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font: 1.35rem var(--serif); white-space: nowrap; }
.mark { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid #93b4cb; border-radius: .2rem; font-size: 1.1rem; }
.masthead nav { display: flex; gap: .1rem; flex-wrap: wrap; }
.masthead nav a { padding: .5rem .75rem; font-size: .925rem; border-radius: .25rem; }
.masthead nav a:hover, .masthead nav a[aria-current] { background: #29465d; }
.masthead :focus-visible { outline-color: #a8dfff; }
.search-button { background: transparent; color: #fff; border-color: #7790a4; font-size: .9rem; }
.search-button:hover { background: #29465d; }
kbd { margin-left: .4rem; color: #c5d8e7; font: .75rem var(--mono); }
main, .footer > div { width: min(100%, 1500px); padding-inline: clamp(1rem, 4vw, 3rem); margin-inline: auto; }
main { padding-block: clamp(1.35rem, 3.4vw, 3rem); min-height: 70vh; }
.footer { border-top: 1px solid var(--line); margin-top: 1rem; }
.footer > div { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; padding-block: 1.2rem; font-size: .875rem; }
.heading { margin-bottom: 1.25rem; }
.heading p { margin-top: .6rem; max-width: 66ch; color: var(--muted); }
.table-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.index-note { text-align: right; white-space: nowrap; font-size: .85rem; color: var(--muted); padding-bottom: .15rem; }
.index-note strong { display: block; font: 1.8rem var(--serif); color: var(--ink); }
.controls { display: flex; flex-wrap: wrap; gap: .55rem .75rem; align-items: end; margin-bottom: .9rem; }
.field { display: grid; grid-template-rows: auto auto; gap: .25rem; min-width: 0; }
.field span { color: var(--muted); font-size: .875rem; font-weight: 550; }
.grow { flex: 1 1 14rem; }
.field input { width: 100%; min-width: 0; }
.board { background: var(--white); border: 1px solid var(--line); border-radius: .4rem; }
.board-scroll { overflow-x: auto; padding: .7rem .85rem .8rem; }
.periodic-grid {
  display: grid; grid-template-columns: 1.1rem repeat(18, minmax(0, 1fr)); grid-template-rows: auto repeat(7, clamp(2.85rem, 4.35vw, 3.9rem)) .55rem repeat(2, clamp(2.85rem, 4.35vw, 3.9rem));
  gap: .24rem; min-width: 710px; position: relative;
}
.grid-label { text-align: center; align-self: center; color: var(--muted); font: .73rem var(--mono); }
.element-tile, .series-marker {
  min-width: 0; position: relative; border: 1px solid var(--line); border-top: 3px solid var(--tint, #879bae);
  border-radius: .25rem; background: var(--shade, #edf1f4); color: var(--ink); text-decoration: none;
}
.element-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.element-tile:hover, .element-tile:focus-visible { border-color: var(--ink); z-index: 1; box-shadow: 0 0 0 1px var(--ink); }
.element-tile.dimmed { opacity: .25; }
.element-tile.dimmed:hover, .element-tile.dimmed:focus-visible { opacity: 1; }
.tile-number, .tile-value { font: .69rem var(--mono); }
.tile-number { position: absolute; top: .12rem; left: .25rem; }
.tile-symbol { font-size: clamp(1rem, 1.65vw, 1.4rem); font-weight: 720; margin: .67rem 0 .1rem; }
.series-marker { display: grid; place-items: center; font: .68rem var(--mono); border-style: dashed; }
.board-note { grid-area: 2 / 5 / 5 / 13; align-self: center; padding: .65rem 1rem; }
.board-note strong { display: block; font: 1.7rem var(--serif); }
.board-note p { font-size: .875rem; color: var(--muted); margin-top: .3rem; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1.15rem; align-items: center; padding: .65rem .85rem; margin: 0; list-style: none; border-top: 1px solid var(--line); }
.legend li { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted); }
.swatch { width: .8rem; height: .8rem; border: 2px solid var(--tint); background: var(--shade); border-radius: .12rem; }
.scroller-hint { display: none; padding: 0 .85rem .55rem; }
.reference-links { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: 1rem; font-size: .93rem; }
.card { padding: clamp(1rem, 3vw, 1.75rem); background: white; border: 1px solid var(--line); border-radius: .4rem; min-width: 0; }
.panel + .panel, .card + .card { margin-top: 1rem; }
.breadcrumbs { display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: .875rem; }
.hero-element { display: flex; align-items: center; gap: clamp(.75rem, 4vw, 1.5rem); margin-bottom: 1.35rem; }
.hero-symbol {
  flex: none; background: var(--shade); border: 1px solid var(--line); border-top: .3rem solid var(--tint);
  width: clamp(4.5rem, 12vw, 7rem); aspect-ratio: 1; border-radius: .35rem; display: grid; place-content: center; text-align: center;
}
.hero-symbol strong { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1; }
.hero-symbol span { font: .85rem var(--mono); }
.hero-element p { margin-top: .35rem; }
.subnav { display: flex; flex-wrap: wrap; gap: .15rem .9rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.subnav a { padding: .55rem .2rem; text-decoration: none; }
.subnav a[aria-current] { border-bottom: 3px solid var(--blue); font-weight: 650; color: var(--ink); }
.prose { max-width: 77ch; }
.prose h2, .prose h3 { margin: 1.5rem 0 .55rem; }
.prose > :first-child { margin-top: 0; }
.prose p { line-height: 1.68; }
.prose .formula { margin-block: 1rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; margin-block: 1rem; }
.metrics div { border-top: 1px solid var(--line); padding-top: .5rem; }
.metrics dt { color: var(--muted); font-size: .875rem; }
.metrics dd { margin: .2rem 0 0; overflow-wrap: anywhere; font-weight: 600; }
.tablescroll { overflow: auto; border: 1px solid var(--line); border-radius: .25rem; margin-top: .75rem; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); }
thead, tbody tr:nth-child(even) { background: var(--page); }
thead th { white-space: nowrap; font-size: .875rem; }
th button { padding: .1rem; min-height: 1.9rem; border: 0; background: transparent; font-weight: 650; }
tbody tr:last-child > * { border-bottom: 0; }
.table-link { border: 0; min-height: auto; background: transparent; color: var(--blue); padding: .16rem .2rem; text-decoration: underline; }
.detail-pane { margin-top: 1rem; padding: 1rem; border-left: 3px solid #aac3d7; background: var(--page); }
.orbitals { display: grid; gap: .35rem; margin: 1rem 0; }
.orbital { display: flex; align-items: center; flex-wrap: wrap; gap: .22rem; font-family: var(--mono); }
.orbital-label { width: 3.9rem; }
.orbital-box { display: inline-grid; place-content: center; width: 2rem; height: 1.9rem; border: 1px solid var(--line); background: #f8fafb; }
.formula { display: block; height: auto; max-width: 100%; }
.library-layout { display: grid; grid-template-columns: minmax(15rem, .85fr) minmax(0, 2fr); gap: 1rem; }
.library-list { margin: .75rem 0 0; padding: 0; list-style: none; max-height: 34rem; overflow-y: auto; }
.library-list a { display: block; padding: .45rem .35rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.library-list a[aria-current] { background: var(--active); }
.section-name { margin-bottom: .45rem; color: var(--muted); font-size: .875rem; }
.reading-list { padding-left: 1.5rem; }
.reading-list li { margin-bottom: .55rem; }
.timeline { padding: 0; list-style: none; margin: 1rem 0 0; }
.timeline li { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; border-top: 1px solid var(--line); padding: .8rem 0; }
.timeline time { font: 1.05rem var(--mono); }
.chart { display: block; width: 100%; height: clamp(250px, 41vw, 400px); }
.chart-caption { margin-top: .55rem; }
.chart-values { margin-top: .9rem; }
.chart-values summary { cursor: pointer; color: var(--blue); }
.bar-list { display: grid; gap: .6rem; margin: 1rem 0; }
.bar-row { display: grid; grid-template-columns: 3rem 1fr minmax(6.5rem, auto); align-items: center; gap: .6rem; }
.bar-row meter { width: 100%; height: 1.2rem; }
dialog { color: var(--ink); width: min(42rem, calc(100% - 2rem)); max-height: 82vh; border: 1px solid var(--line); border-radius: .5rem; padding: 1.25rem; box-shadow: 0 8px 40px #0a203045; }
dialog::backdrop { background: #142a3dcc; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
dialog input { display: block; width: 100%; margin-bottom: .65rem; }
.search-results { list-style: none; padding: 0; margin: .45rem 0 0; }
.search-results a { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .75rem; padding: .5rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.search-results a:hover, .search-results a:focus-visible { background: var(--active); }
@media (max-width: 790px) { .scroller-hint { display: block; } }
@media (max-width: 700px) {
  .masthead nav { order: 3; width: 100%; }
  .masthead nav a { padding: .4rem .55rem; }
  .table-heading { align-items: start; }
  .index-note, kbd { display: none; }
  .library-layout { grid-template-columns: 1fr; }
  .library-list { max-height: 13rem; }
  .timeline li { grid-template-columns: 4rem 1fr; gap: .6rem; }
}
.library-layout aside > .field + .field { margin-top: .75rem; }
.library-layout aside > .quiet { margin-top: .6rem; }
.license { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .875rem; }
[aria-sort="ascending"] button::after { content: " ▲"; font-size: .65rem; }
[aria-sort="descending"] button::after { content: " ▼"; font-size: .65rem; }

@media (max-width: 1000px) {
  .tile-number, .tile-value { font-size: .61rem; }
  .periodic-grid { gap: .18rem; }
  .tile-number { left: .17rem; }
  .series-marker { font-size: .55rem; }
}

#terms-notice {
  width: min(28rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: 1.35rem;
}
#terms-notice h2 { margin-bottom: .8rem; }
#terms-notice-title:focus { outline: none; }
#terms-notice > p { margin-top: .85rem; }
.terms-agreement { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .8rem; }
.terms-agreement label { display: flex; align-items: start; gap: .6rem; cursor: pointer; font-weight: 600; }
.terms-agreement input { flex: none; width: 1.2rem; height: 1.2rem; margin: .17rem 0 0; accent-color: var(--blue); cursor: pointer; }
.terms-agreement p:not(:empty) { margin-top: .45rem; }
.terms-storage-warning { margin: 1rem auto; max-width: 65ch; padding: 0 1rem; color: var(--muted); }

.site-identity, .site-credit {
  display: inline-flex;
  align-items: center;
}
.site-identity { gap: .85rem; }
.site-credit {
  gap: .4rem;
  padding-right: .85rem;
  border-right: 1px solid #547086;
  color: #d4e2ed;
  white-space: nowrap;
  font-size: .875rem;
}
.site-credit picture, .site-credit img { display: block; flex: none; }
.bar-row { grid-template-columns: 3rem minmax(0, 1fr) minmax(8rem, 42%); }

@media (max-width: 1000px) {
  .atlas-nav { order: 3; width: 100%; }
}
@media (max-width: 480px) {
  .site-identity { gap: .5rem; }
  .site-credit { padding-right: .5rem; gap: .25rem; }
  .site-credit img { width: 28px; height: 28px; }
  .brand { font-size: 1.15rem; gap: .35rem; }
  .mark { width: 1.7rem; height: 1.7rem; font-size: .95rem; }
}
