:root {
  color-scheme: dark;
  --charcoal: #0f1115;
  --graphite: #2a2e35;
  --orange: #ff8a1f;
  --glow: #ffb347;
  --text: #f5f7fa;
  --muted: #aab0bd;
  --edge: #323643;
  --panel: #11151d;
  --family: #7dd8d0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--charcoal);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(ellipse at 68% 0%, #1b1823 0%, transparent 39%),
    var(--charcoal);
  min-width: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button,
[type="search"],
select,
[type="number"] {
  background: #151922;
  border: 1px solid var(--edge);
  border-radius: 9px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: absolute;
  z-index: 10;
  top: 10px;
  left: 10px;
  background: var(--orange);
  color: #180d03;
  padding: 12px;
  border-radius: 8px;
}
.shell {
  width: min(100% - 64px, 1440px);
  margin-inline: auto;
}
.sitebar {
  border-bottom: 1px solid #262833;
  background: #0f1115be;
}
.bar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 780;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.brand b {
  color: var(--orange);
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 3px;
  padding: 8px;
  border: 1px solid #ff8a1f55;
  border-radius: 9px;
  background: #2c1d15;
}
.brand-mark i {
  width: 6px;
  height: 6px;
  background: var(--glow);
  border-radius: 2px;
}
.brand-mark i:nth-child(2) {
  opacity: 0.48;
}
nav {
  display: flex;
  gap: 24px;
  align-items: center;
  color: #ced1d9;
  font-size: 0.9rem;
  font-weight: 650;
}
nav a:hover,
.source-note a:hover,
.site-footer a:hover {
  color: var(--glow);
}
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(370px, 0.92fr);
  gap: 35px;
  align-items: center;
  padding: 42px 0 32px;
}
.intro-label {
  font-size: 0.76rem;
  font-weight: 730;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--glow);
  margin: 0 0 12px;
}
.intro-label span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px #ff8a1f8c;
  margin-right: 7px;
  vertical-align: 1px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(3rem, 5.15vw, 5.3rem);
  font-weight: 760;
  line-height: 0.98;
  letter-spacing: -0.071em;
}
h1 em {
  color: var(--orange);
  font-style: normal;
}
.intro-copy {
  font-size: 1rem;
  color: #c0c4ce;
  line-height: 1.52;
  max-width: 39ch;
  margin-top: 15px;
}
.search {
  display: flex;
  gap: 9px;
  align-items: center;
  position: relative;
  margin-top: 18px;
  max-width: 410px;
}
.search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 13px 0 38px;
  background: #171b25;
}
.search button {
  height: 44px;
  padding-inline: 15px;
  color: #1d0f06;
  background: var(--orange);
  border-color: var(--orange);
  font-weight: 750;
}
.search-icon {
  position: absolute;
  left: 14px;
  width: 13px;
  height: 13px;
  border: 1.5px solid #b7bdc9;
  border-radius: 50%;
  pointer-events: none;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.5px;
  background: #b7bdc9;
  right: -4px;
  bottom: -2px;
  transform: rotate(45deg);
}
.spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(4px, 1.2vw, 15px);
  align-items: center;
  min-height: 255px;
  padding: 15px 20px 15px 8px;
  border: 1px solid color-mix(in srgb, var(--family) 24%, #242735);
  border-radius: 22px;
  background:
    radial-gradient(
      ellipse at 25% 51%,
      color-mix(in srgb, var(--family) 18%, #0d1018),
      transparent 66%
    ),
    linear-gradient(135deg, #141722, #0a0d14 72%);
  overflow: hidden;
  scroll-margin-block-start: .75rem;
}
.spotlight-content {
  position: relative;
  min-width: 0;
}
.spotlight-art {
  position: relative;
  align-self: stretch;
  min-width: 0;
  min-height: 200px;
  pointer-events: none;
}
.spotlight-art :is(img, canvas) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.spotlight-motion:not([hidden]) {
  position: absolute;
  inset: auto auto 8px 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #42495c;
  border-radius: 50%;
  color: #edf0fb;
  background: #0e121bea;
  cursor: pointer;
}
.spotlight-motion:hover {
  background: #222938;
}
.spotlight-motion:focus-visible {
  outline: 2px solid #e9edff;
  outline-offset: 2px;
}
.spotlight-motion::before {
  content: "";
  width: 10px;
  height: 12px;
  box-sizing: border-box;
  border-inline: 3px solid currentColor;
}
.spotlight-motion[data-paused="true"]::before {
  width: 0;
  height: 0;
  margin-inline-start: 2px;
  border: 0;
  border-block: 6px solid transparent;
  border-inline-start: 9px solid currentColor;
}
.spotlight-label {
  margin: 0 0 .35rem;
  color: var(--text);
  font-size: .78rem;
  letter-spacing: .035em;
  font-weight: 700;
}
.focus-symbol {
  color: var(--family);
  font-weight: 650;
}
.focus-family {
  color: var(--family);
  font-size: 0.8rem;
  font-weight: 680;
}
.spotlight h2,
.dialog-head h2 {
  font-size: clamp(1.42rem, 2.6vw, 2.7rem);
  line-height: 1.07;
  letter-spacing: -0.055em;
  margin: 0.12em 0 0.5em;
  overflow-wrap: anywhere;
}
.spotlight h2 {
  min-height: 2.14em;
}
.quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  margin: 0 0 16px;
}
.quick-facts dt {
  color: var(--muted);
  font-size: 0.71rem;
}
.quick-facts dd {
  margin: 3px 0 0;
  font-size: 0.87rem;
  font-weight: 720;
}
.detail-link {
  display: inline-flex;
  align-items: center;
  min-height: 33px;
  border: 1px solid color-mix(in srgb, var(--family) 28%, #252934);
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--family);
  font-size: 0.81rem;
  font-weight: 720;
}
.detail-link:hover {
  background: color-mix(in srgb, var(--family) 12%, #141822);
}
.spotlight .detail-link {
  min-height: 44px;
}
.workbench {
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: #11141ce6;
  overflow: hidden;
}
.worktop,
.controls,
.legend-row,
.source-note {
  padding-inline: 18px;
}
.worktop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 16px;
}
.worktop h2,
.explore h2 {
  font-size: 1.39rem;
  letter-spacing: -0.038em;
}
.worktop p {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}
.mode-switch {
  display: inline-flex;
  flex-shrink: 0;
  gap: 3px;
  padding: 3px;
  background: #0b0e15;
  border: 1px solid #333744;
  border-radius: 11px;
}
.mode-switch button {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 710;
  white-space: nowrap;
}
.mode-switch button span {
  margin-right: 4px;
}
.mode-switch button[aria-pressed="true"] {
  background: #2c1c12;
  color: var(--glow);
  border-color: #f98a3150;
}
.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-block: 9px;
  border-block: 1px solid #242934;
  background: #151923;
  color: #d4d7df;
}
.controls label {
  font-size: 0.81rem;
  font-weight: 690;
}
.controls select,
.controls button {
  min-height: 44px;
  min-width: 44px;
  padding: 4px 7px;
  font-size: 1rem;
}
#view-select {
  margin-right: 12px;
}
.temperature,
.timeline {
  display: flex;
  gap: 7px;
  align-items: center;
}
input[type="range"] {
  accent-color: var(--orange);
  width: clamp(104px, 15vw, 225px);
  cursor: pointer;
}
.controls input[type="range"] {
  min-height: 44px;
}
.controls input[type="number"] {
  height: 44px;
  width: 72px;
  padding: 4px 5px;
  font-size: 1rem;
  text-align: center;
}
.fit-button,
#fit-button,
.mobile-hint {
  display: none;
}
#tile-tap-hint {
  display: none;
}
@media (any-pointer: coarse) {
  #tile-tap-hint {
    display: inline;
  }
}
.table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #4a5062 #11141c;
  padding: 9px 16px 15px;
}
.periodic-grid {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-columns: 19px repeat(18, minmax(0, 1fr));
  grid-template-rows: 17px repeat(7, minmax(47px, 1fr)) 4px repeat(
      2,
      minmax(47px, 1fr)
    );
  gap: 4px;
  min-width: 770px;
}
.group-number {
  grid-column: var(--column);
  grid-row: 1;
  place-self: center;
  color: #9ba2b4;
  font-size: 0.66rem;
}
.f-note {
  grid-column: 4;
  display: grid;
  place-items: center;
  border: 1px dashed #594e5d;
  border-radius: 5px;
  color: #b2a4bb;
  font-size: 0.65rem;
}
.lanthanoids {
  grid-row: 7;
}
.actinoids {
  grid-row: 8;
}
.tile {
  --level: 0%;
  position: relative;
  display: block;
  grid-column: var(--column);
  grid-row: var(--row);
  border-radius: 6px;
  min-width: 0;
  outline-offset: 1px;
  transition: opacity 0.18s;
  user-select: none;
}
.tile[data-series-row="8"],
.tile[data-series-row="9"] {
  grid-row: calc(var(--row) + 1);
}
.tile-inner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 52px;
  gap: 1px;
  padding: 4px 4px 3px;
  background: linear-gradient(
    152deg,
    color-mix(in srgb, var(--family) 19%, #141720),
    color-mix(in srgb, var(--family) 5%, #131720)
  );
  border: 1px solid color-mix(in srgb, var(--family) 36%, #252936);
  border-radius: 6px;
}
.tile:hover,
.tile:focus-visible,
.tile.is-selected {
  z-index: 3;
}
.tile:hover .tile-inner,
.tile:focus-visible .tile-inner,
.tile.is-selected .tile-inner {
  border-color: var(--family);
  box-shadow: 0 0 11px color-mix(in srgb, var(--family) 34%, transparent);
}
.tile.is-selected .tile-inner {
  outline: 2px solid var(--family);
  outline-offset: -2px;
}
.tile:focus-visible {
  outline: 3px solid var(--glow);
  outline-offset: -1px;
}
.tile:focus-visible .tile-inner {
  outline: 2px solid var(--glow);
  outline-offset: -3px;
}
.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.tile .number,
.tile .value {
  color: #d2d8e2;
  font-size: clamp(0.5rem, 0.68vw, 0.69rem);
  line-height: 1.12;
}
.tile strong {
  display: block;
  color: var(--family);
  line-height: 1;
  font-size: clamp(1rem, 1.45vw, 1.44rem);
  font-weight: 760;
}
.tile .name {
  color: #eaedf6;
  font-size: clamp(0.44rem, 0.63vw, 0.66rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.tile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.family-mark {
  display: inline-block;
  margin-left: auto;
  width: 1em;
  height: 1em;
  color: var(--family);
  font-size: 0.64rem;
  font-style: normal;
  line-height: 1;
  text-align: center;
}
.family-mark::before {
  content: var(--family-symbol);
}
.state-mark {
  font-size: 0.64rem;
  line-height: 1;
  color: #e1e5ee;
}
.state-mark::before {
  content: "?";
}
[data-phase="solid"] .state-mark::before {
  content: "■";
  font-size: 0.41rem;
}
[data-phase="liquid"] .state-mark::before {
  content: "≈";
}
[data-phase="gas"] .state-mark::before {
  content: "⠿";
}
.enhanced .tile[data-phase="gas"] .tile-inner::after,
.enhanced .tile[data-phase="liquid"] .tile-inner::after {
  position: absolute;
  z-index: -1;
  content: "";
  inset: 0;
  pointer-events: none;
}
.enhanced .tile[data-phase="gas"] .tile-inner::after {
  background:
    radial-gradient(circle at 24% 20%, #ffffff55 0 1px, transparent 2px),
    radial-gradient(circle at 73% 62%, #ffffff3d 0 1px, transparent 2px),
    radial-gradient(
      circle at 62% 25%,
      color-mix(in srgb, var(--family) 34%, transparent),
      transparent 65%
    );
  animation: drift 5s alternate ease-in-out infinite;
}
.enhanced .tile[data-phase="liquid"] .tile-inner::after {
  background: linear-gradient(
    168deg,
    transparent 49%,
    color-mix(in srgb, var(--family) 24%, transparent) 51%,
    transparent 53%
  );
  animation: ripple 4s ease-in-out infinite alternate;
}
@keyframes drift {
  from {
    transform: translateY(6px);
    opacity: 0.4;
  }
  to {
    transform: translateY(-6px);
    opacity: 0.85;
  }
}
@keyframes ripple {
  from {
    transform: translateY(9px);
  }
  to {
    transform: translateY(17px);
  }
}

.enhanced .tile[data-phase-change] .tile-inner::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}
.enhanced .tile[data-phase-change="melt"] .tile-inner::after {
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--family) 60%, transparent),
    transparent
  );
  animation: phase-cross-melt 450ms ease-out both;
}
.enhanced .tile[data-phase-change="boil"] .tile-inner::after {
  background:
    radial-gradient(circle at 28% 42%, #ffffffa6 0 2px, transparent 3px),
    radial-gradient(circle at 64% 62%, #ffffff80 0 2px, transparent 3px),
    radial-gradient(
      circle at 58% 34%,
      color-mix(in srgb, var(--family) 65%, transparent),
      transparent 67%
    );
  animation: phase-cross-boil 520ms ease-out both;
}
.enhanced .tile[data-phase-change="cool"] .tile-inner::after {
  background: color-mix(in srgb, #d5efff 45%, transparent);
  animation: phase-cross-cool 380ms ease-out both;
}
@keyframes phase-cross-melt {
  from {
    opacity: 0.9;
    transform: translateY(-38%);
  }
  to {
    opacity: 0;
    transform: translateY(44%);
  }
}
@keyframes phase-cross-boil {
  from {
    opacity: 0.95;
    transform: translateY(14%) scale(0.82);
  }
  to {
    opacity: 0;
    transform: translateY(-28%) scale(1.35);
  }
}
@keyframes phase-cross-cool {
  from {
    opacity: 0.9;
  }
  to {
    opacity: 0;
  }
}
.tile.is-muted {
  opacity: 0.24;
}
[data-family="alkali-metal"] {
  --family-symbol: "●";
  --family: #ff9f62;
}
[data-family="alkaline-earth-metal"] {
  --family-symbol: "■";
  --family: #f9ca72;
}
[data-family="transition-metal"] {
  --family-symbol: "▲";
  --family: #79bbff;
}
[data-family="post-transition-metal"] {
  --family-symbol: "◆";
  --family: #ada1ff;
}
[data-family="metalloid"] {
  --family-symbol: "✦";
  --family: #62dbc6;
}
[data-family="nonmetal"] {
  --family-symbol: "○";
  --family: #83de9f;
}
[data-family="halogen"] {
  --family-symbol: "□";
  --family: #e9ed88;
}
[data-family="noble-gas"] {
  --family-symbol: "△";
  --family: #f299cb;
}
[data-family="lanthanide"] {
  --family-symbol: "◇";
  --family: #c9a9ed;
}
[data-family="actinide"] {
  --family-symbol: "+";
  --family: #fc8e98;
}
[data-family="unknown"] {
  --family-symbol: "·";
  --family: #aab2c1;
}
.materials .tile.has-photo .tile-inner {
  background: #13161e;
}
.materials .tile.has-photo .tile-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #101219a8, #0a0c1266 48%, #0a0c12e8);
}
.materials .tile.has-photo strong {
  color: #fff;
  text-shadow: 0 1px 4px #000;
}
.materials .tile.has-photo .value {
  color: #f0d9b5;
}
.materials .tile:not(.has-photo) .tile-photo {
  background: repeating-linear-gradient(
    -38deg,
    transparent 0 6px,
    #a0a8bb0e 7px 8px
  );
}
.materials .value {
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.phase-summary,
.height-legend {
  padding: 8px 18px 0;
  color: #d4d7df;
  font-size: 0.86rem;
}
.height-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  color: var(--muted);
}
.height-gradient {
  display: inline-block;
  width: 64px;
  height: 0.6rem;
  border-radius: 3px;
  background: linear-gradient(90deg, #2864a3, #9b511f);
}
.height-legend span:last-child {
  color: #b4bac6;
}
.trend-stage {
  padding-block: 54px 44px;
}
.periodic-grid.trend {
  isolation: auto;
  transform-origin: center;
  transform: perspective(1700px) rotateX(34deg);
  transform-style: preserve-3d;
  --max-height: 96px;
}
.trend .tile {
  --height-color: color-mix(in srgb, #2864a3, #9b511f var(--height-mix, 0%));
  --raised: calc(6px + var(--max-height) * var(--height-fraction, 0));
  transform: translateZ(var(--raised));
  transform-style: preserve-3d;
}
.trend .tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--raised);
  transform-origin: bottom;
  transform: rotateX(90deg);
  background: linear-gradient(
    0deg,
    var(--height-color),
    color-mix(in srgb, var(--height-color) 73%, #0c111a)
  );
  border-inline: 1px solid color-mix(in srgb, var(--height-color) 65%, #192231);
  pointer-events: none;
}
.trend .tile-inner {
  background: linear-gradient(
    150deg,
    var(--height-color),
    color-mix(in srgb, var(--height-color) 78%, #161b23)
  );
  border-color: color-mix(in srgb, var(--height-color) 55%, #c3cbdb);
}
.trend .tile :is(strong, .number, .name, .value, .family-mark, .state-mark) {
  color: #fff;
}
.trend .tile.no-property-data {
  --raised: 0px;
}
.trend .tile.no-property-data .tile-inner {
  border-style: dashed;
  background: #232833;
}
.trend .tile .value {
  overflow-wrap: anywhere;
}
.timeline-layout .group-number,
.timeline-layout .f-note,
.spiral .group-number,
.spiral .f-note {
  display: none;
}
.timeline-layout {
  grid-template-columns: repeat(18, minmax(0, 1fr));
  grid-template-rows: none;
  grid-auto-rows: minmax(49px, auto);
}
.timeline-layout .tile {
  grid-column: auto;
  grid-row: auto;
}
.periodic-grid.spiral {
  display: block;
  width: min(100%, 820px);
  min-width: 780px;
  aspect-ratio: 1;
  margin-inline: auto;
}
.spiral::before {
  content: "";
  position: absolute;
  inset: 4% 18%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle,
    transparent 0 38px,
    #a1a8c31b 39px 40px,
    transparent 41px 76px
  );
  pointer-events: none;
}
.spiral .tile {
  position: absolute;
  left: calc(50% + var(--x));
  top: calc(50% + var(--y));
  width: 44px;
  height: 44px;
  translate: -50% -50%;
}
.spiral .tile-inner {
  min-height: 0;
  padding: 2px;
  align-items: center;
  justify-content: center;
}
.spiral .tile strong {
  font-size: 0.9rem;
}
.spiral .tile :is(.number, .family-mark, .name, .value) {
  display: none;
}
.spiral .tile .tile-top {
  position: absolute;
  inset: 2px 3px auto auto;
}
.spiral .tile strong {
  padding-top: 3px;
}
.legend-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-block: 3px 10px;
}
.legend,
.phase-key {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.legend button,
.phase-key span {
  white-space: nowrap;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.69rem;
  color: #c2c6d0;
}
.legend button {
  min-height: 44px;
  min-width: 44px;
  background: #151923;
  border: 1px solid #2b3040;
}
.legend button[aria-pressed="true"] {
  border-color: var(--family);
  color: var(--family);
}
.legend .family-mark {
  margin-right: 5px;
}
.phase-key {
  flex-shrink: 0;
  justify-content: flex-end;
}
.source-note {
  display: flex;
  gap: 10px 16px;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-block: 9px;
  border-top: 1px solid #262a34;
  color: var(--muted);
  font-size: 0.74rem;
}
.source-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.table-guide {
  margin-top: 24px;
  padding: clamp(16px, 3vw, 32px);
  border: 1px solid var(--edge);
  border-radius: 15px;
  background: #11141ce6;
}
.table-guide h2 {
  font-size: 1.39rem;
  letter-spacing: -0.038em;
}
.table-guide p {
  max-width: 75ch;
  margin-top: 10px;
  color: #c0c4ce;
  line-height: 1.65;
}
.explore {
  padding: 27px 0 36px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 13px;
}
.tool-grid a {
  padding: 14px 15px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: #151821;
}
.tool-grid a:hover {
  border-color: var(--orange);
}
.tool-grid p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 0 26px;
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font-size: 0.8rem;
}
.site-footer div {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
}
.element-dialog {
  max-height: min(90vh, 680px);
  width: min(calc(100% - 24px), 450px);
  color: var(--text);
  background: #161923;
  border: 1px solid #45495a;
  border-radius: 17px;
  padding: 18px;
  overflow: auto;
}
.element-dialog::backdrop {
  background: #080a12bd;
}
.dialog-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 1.65rem;
}
.dialog-head p {
  color: var(--family);
  font-size: 0.8rem;
}
#dialog-symbol {
  padding: 8px;
  min-width: 47px;
  border: 1px solid var(--family);
  border-radius: 9px;
  text-align: center;
  color: var(--family);
  font-size: 1.38rem;
  font-weight: 740;
}
.dialog-head button {
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
}
.element-dialog img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  background: #0f1115;
  border-radius: 10px;
  margin-bottom: 12px;
}
.photo-source {
  margin-left: 12px;
  font-size: 0.78rem;
  text-decoration: underline;
}
@media (max-width: 1030px) {
  .shell {
    width: calc(100% - 38px);
  }
  .intro {
    gap: 22px;
  }
  .legend-row {
    flex-wrap: wrap;
  }
  .phase-key {
    justify-content: flex-start;
  }
  .periodic-grid {
    min-width: 745px;
  }
}
@media (max-width: 760px) {
  .shell {
    width: calc(100% - 24px);
  }
  .bar {
    min-height: 54px;
    height: auto;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 8px;
  }
  .brand {
    min-height: 44px;
    font-size: 1.03rem;
  }
  .brand-mark {
    padding: 6px;
  }
  nav {
    flex-wrap: wrap;
    gap: 0 9px;
    min-width: 0;
    font-size: 0.78rem;
  }
  nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  nav .optional {
    display: none;
  }
  .intro {
    display: block;
    padding: 23px 0 19px;
  }
  h1 {
    font-size: clamp(2.6rem, 8.7vw, 4rem);
    letter-spacing: -0.065em;
  }
  h1 br {
    display: none;
  }
  .intro-label {
    margin-bottom: 8px;
    font-size: 0.68rem;
  }
  .intro-copy {
    margin-top: 9px;
    font-size: 0.92rem;
  }
  .search {
    max-width: none;
    margin-top: 12px;
  }
  .search input {
    font-size: 16px;
  }
  .search button {
    min-width: 44px;
  }
  .spotlight {
    grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
    min-height: 168px;
    margin-top: 13px;
    padding: 9px 11px 9px 3px;
    gap: 5px;
    border-radius: 13px;
  }
  .spotlight-art {
    min-height: 145px;
  }
  .spotlight-label {
    margin-bottom: 2px;
  }
  .spotlight h2 {
    margin: 1px 0 4px;
    font-size: 1.3rem;
  }
  .spotlight .focus-family {
    font-size: 0.72rem;
  }
  .spotlight .quick-facts {
    margin: 0 0 4px;
    gap: 4px 8px;
  }
  .spotlight .quick-facts dd {
    font-size: 0.79rem;
  }
  .spotlight .detail-link {
    width: fit-content;
    min-height: 44px;
    text-align: center;
    font-size: 0.76rem;
  }
  .workbench {
    border-radius: 13px;
  }
  .worktop,
  .controls,
  .legend-row,
  .source-note,
  .phase-summary,
  .height-legend {
    padding-inline: 10px;
  }
  .worktop {
    flex-wrap: wrap;
    padding-block: 10px;
    gap: 6px;
  }
  .worktop h2 {
    font-size: 1.08rem;
  }
  .worktop p {
    font-size: 0.78rem;
  }
  .mode-switch button {
    min-height: 44px;
    min-width: 44px;
    padding: 6px;
    font-size: 0.79rem;
  }
  .mode-switch button span {
    display: none;
  }
  .controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-block: 8px;
    gap: 5px;
  }
  .controls label {
    font-size: 0.81rem;
  }
  #view-select {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
  }
  .temperature,
  .timeline {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto auto 44px;
    gap: 5px;
  }
  .timeline {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .temperature label,
  .timeline label {
    grid-column: 1 / -1;
    margin-top: 4px;
  }
  .controls input[type="range"] {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin-inline: 0;
  }
  .controls select,
  .controls input[type="number"],
  .controls button {
    min-height: 44px;
    font-size: 16px;
  }
  .controls input[type="number"] {
    width: 86px;
  }
  #temperature-unit {
    min-width: 52px;
  }
  #fit-button {
    display: block;
    grid-column: 2;
    grid-row: 1;
    white-space: nowrap;
  }
  .mobile-hint {
    display: block;
    padding: 5px 10px 0;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .table-scroll {
    padding: 6px 8px 12px;
  }
  .trend-stage {
    padding-block: 37px 35px;
  }
  .periodic-grid {
    min-width: 857px;
    grid-template-columns: 11px repeat(18, minmax(0, 1fr));
    grid-template-rows: 17px repeat(7, minmax(44px, 1fr)) 4px repeat(
        2,
        minmax(44px, 1fr)
      );
    gap: 3px;
  }
  .periodic-grid.trend {
    --max-height: 65px;
  }
  .tile-inner {
    min-height: 44px;
    padding: 3px;
  }
  .tile .name {
    display: none;
  }
  .tile .value {
    font-size: 0.6rem;
  }
  .tile strong {
    font-size: 1rem;
  }
  .f-note {
    font-size: 0.56rem;
  }
  .fit .periodic-grid:not(.spiral) {
    min-width: 0;
    grid-template-columns: 4px repeat(18, minmax(0, 1fr));
    grid-template-rows: 13px repeat(7, minmax(27px, 1fr)) 2px repeat(
        2,
        minmax(27px, 1fr)
      );
    gap: 1px;
  }
  .fit .periodic-grid.trend {
    transform: perspective(1700px) rotateX(31deg);
    --max-height: 26px;
  }
  .fit .periodic-grid.spiral {
    min-width: 0;
  }
  .fit .spiral .tile {
    width: clamp(15px, 5.2vw, 30px);
    height: clamp(15px, 5.2vw, 30px);
  }
  .fit .tile-inner {
    min-height: 26px;
    padding: 1px;
    border-radius: 3px;
    justify-content: center;
    align-items: center;
  }
  .fit .tile strong {
    font-size: clamp(0.5rem, 2.55vw, 0.76rem);
  }
  .fit .tile .number,
  .fit .tile .state-mark {
    font-size: 0.44rem;
  }
  .fit .tile-top {
    gap: 0;
  }
  .fit .tile :is(.name, .value, .family-mark) {
    display: none;
  }
  .fit .tile[data-phase="solid"] .state-mark::before {
    font-size: 0.28rem;
  }
  .fit .spiral .tile-inner {
    min-height: 0;
  }
  .fit .spiral .tile .state-mark {
    display: none;
  }
  .fit .f-note {
    font-size: 0.43rem;
  }
  .fit .group-number {
    font-size: 0.48rem;
  }
  .periodic-grid.timeline-layout,
  .fit .periodic-grid.timeline-layout {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: none;
  }
  .legend-row {
    padding-block: 3px 7px;
  }
  .legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    min-width: 0;
    padding-bottom: 3px;
  }
  .legend button {
    flex: 0 0 auto;
    min-height: 44px;
  }
  .phase-key {
    flex-shrink: 1;
  }
  .phase-key span {
    padding: 2px 4px;
  }
  .source-note a,
  .site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .element-dialog {
    position: fixed;
    margin: auto 0 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 17px 17px 0 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .dialog-head button,
  .element-dialog .detail-link,
  .element-dialog .photo-source {
    min-width: 44px;
    min-height: 44px;
  }
  .element-dialog .photo-source {
    display: inline-flex;
    align-items: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}

.discovery-heading {
  grid-column: 1 / -1;
  margin: .3rem 0 0;
  align-self: end;
  color: var(--muted);
  font-size: .925rem;
  font-weight: 700;
}

.table-density { display: none; }
.nearby-dialog .dialog-head { grid-template-columns: minmax(0, 1fr) auto; }
.nearby-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nearby-grid button {
  display: grid;
  justify-items: center;
  gap: 2px;
  align-content: center;
  min-height: 62px;
  min-width: 44px;
  padding: 6px 3px;
  border-color: color-mix(in srgb, var(--family) 46%, #45495a);
}
.nearby-grid strong { color: var(--family); font-size: 1.22rem; }
.nearby-grid span { font-size: .75rem; overflow-wrap: anywhere; }
.dialog-head button { min-width: 44px; min-height: 44px; }

@media (width < 700px) {
  #fit-button { display: none; }
  .table-density { display: flex; gap: 6px; padding: 5px 8px 0; }
  .table-density button { flex: 1; min-height: 44px; min-width: 44px; }
  .table-density [aria-pressed="true"] { color: var(--glow); border-color: var(--glow); }
  .workbench:not(.detailed) #tile-tap-hint { display: none; }
  .workbench:not(.detailed) .table-scroll { overflow: clip; touch-action: pan-y pinch-zoom; }
  .workbench:not(.detailed) .periodic-grid:not(.spiral, .timeline-layout) {
    min-width: 0;
    grid-template-columns: 3px repeat(18, minmax(0, 1fr));
    grid-template-rows: 13px repeat(7, 25px) 3px repeat(2, 25px);
    gap: 1px;
  }
  .workbench:not(.detailed) .periodic-grid.trend { transform: perspective(1700px) rotateX(26deg); --max-height: 20px; }
  .workbench:not(.detailed) .periodic-grid.spiral { min-width: 0; }
  .workbench:not(.detailed) .spiral .tile { width: 4.1%; height: 4.1%; }
  .workbench:not(.detailed) .periodic-grid.timeline-layout { min-width: 0; grid-auto-rows: minmax(24px, auto); }
  .workbench:not(.detailed) .tile-inner {
    min-height: 0;
    padding: 0;
    gap: 0;
    border-radius: 3px;
    justify-content: center;
    align-items: center;
  }
  .workbench:not(.detailed) .tile strong { color: var(--family); font-size: clamp(.52rem, 2.6vw, .86rem); padding: 0; }
  .workbench:not(.detailed) .tile :is(.tile-top, .name, .value, .tile-photo) { display: none; }
  .workbench:not(.detailed) .group-number { font-size: .48rem; }
  .workbench:not(.detailed) .f-note { font-size: .44rem; }
}

.phase-line { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 4px; }
.phase-line .phase-summary { min-width: 0; margin-block: 0; }
#warm-up-skip { flex: 0 0 auto; min-width: 44px; min-height: 44px; margin-inline-end: 8px; }
#warm-up-skip[hidden] { display: block !important; visibility: hidden; }
