:root {
  color-scheme: light;
  --ink: #102033;
  --muted: #607085;
  --line: #d6e4ec;
  --panel: #ffffff;
  --mist: #f1fbfd;
  --navy: #12334a;
  --deep-blue: #1a237e;
  --blue: #1588e8;
  --aqua: #00bfa6;
  --cyan: #00bcd4;
  --mint: #8af2d0;
  --coral: #ff6b57;
  --yellow: #ffd84d;
  --violet: #7b61ff;
  --gold: #c78912;
  --red: #dc4c64;
  --shadow: 0 22px 55px rgba(14, 102, 148, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7feff 0, #ffffff 48%, #f3fbff 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 72px;
  padding: 0 3vw;
  color: var(--ink);
  border-bottom: 1px solid rgba(214, 228, 236, 0.9);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(21, 136, 232, 0.08);
  backdrop-filter: blur(18px);
  overflow: visible;
}

.brand,
.nav-links,
.header-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 9px;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 900;
  overflow: visible;
}

.brand-word {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  line-height: 1;
  letter-spacing: 0;
}

.brand-crystal {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  perspective: 900px;
  overflow: visible;
  margin: -7px 0 -7px;
  isolation: isolate;
  vertical-align: middle;
}

.brand-crystal-canvas {
  display: block;
  width: 72px;
  height: 72px;
}

.crystal-stage {
  position: relative;
  width: 36px;
  height: 36px;
  transform: none;
  transform-style: preserve-3d;
  overflow: visible;
}

.crystal-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  animation: crystal-turn 16s infinite linear;
}

@keyframes crystal-turn {
  0% { transform: rotateX(-14deg) rotate3d(1, 1, 1, 0deg) scale(0.5); }
  50% { transform: rotateX(-14deg) rotate3d(1, 1, 1, 180deg) scale(0.47); }
  100% { transform: rotateX(-14deg) rotate3d(1, 1, 1, 360deg) scale(0.5); }
}

.crystal-face {
  position: absolute;
  left: -16.55px;
  width: 33.1px;
  height: 28.66px;
  backface-visibility: visible;
}

.crystal-face.face-top {
  top: -28.66px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform-origin: 50% 100%;
}

.crystal-face.face-bottom {
  top: 0;
  clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
  transform-origin: 50% 0%;
}

.crystal-face {
  border: 0.5px solid rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.14);
  opacity: 0.82;
}

.crystal-face.face-top.front { transform: rotateY(45deg) translateZ(16.55px) rotateX(35.26deg); background: linear-gradient(135deg, rgba(0, 191, 166, 0.38), rgba(138, 242, 208, 0.12)); }
.crystal-face.face-top.right { transform: rotateY(135deg) translateZ(16.55px) rotateX(35.26deg); background: linear-gradient(135deg, rgba(21, 136, 232, 0.24), rgba(0, 191, 166, 0.1)); }
.crystal-face.face-top.back { transform: rotateY(225deg) translateZ(16.55px) rotateX(35.26deg); background: linear-gradient(135deg, rgba(13, 148, 136, 0.3), rgba(255, 255, 255, 0.08)); }
.crystal-face.face-top.left { transform: rotateY(315deg) translateZ(16.55px) rotateX(35.26deg); background: linear-gradient(135deg, rgba(26, 54, 93, 0.22), rgba(138, 242, 208, 0.1)); }
.crystal-face.face-bottom.front { transform: rotateY(45deg) translateZ(16.55px) rotateX(-35.26deg); background: linear-gradient(135deg, rgba(21, 136, 232, 0.32), rgba(255, 255, 255, 0.08)); }
.crystal-face.face-bottom.right { transform: rotateY(135deg) translateZ(16.55px) rotateX(-35.26deg); background: linear-gradient(135deg, rgba(0, 191, 166, 0.28), rgba(21, 136, 232, 0.08)); }
.crystal-face.face-bottom.back { transform: rotateY(225deg) translateZ(16.55px) rotateX(-35.26deg); background: linear-gradient(135deg, rgba(26, 54, 93, 0.26), rgba(255, 255, 255, 0.06)); }
.crystal-face.face-bottom.left { transform: rotateY(315deg) translateZ(16.55px) rotateX(-35.26deg); background: linear-gradient(135deg, rgba(13, 148, 136, 0.24), rgba(138, 242, 208, 0.08)); }

.crystal-node {
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
}

.crystal-node span {
  --atom-light: rgba(186, 255, 239, 0.72);
  --atom-mid: rgba(0, 191, 166, 0.5);
  --atom-deep: rgba(13, 148, 136, 0.62);
  --atom-edge: rgba(13, 74, 68, 0.22);
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 0.45px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  transform-style: preserve-3d;
  background: radial-gradient(circle at 32% 28%, var(--atom-light) 0%, var(--atom-mid) 56%, var(--atom-deep) 100%);
  box-shadow: inset -1.1px -1.1px 3px var(--atom-edge), 0 0 3px color-mix(in srgb, var(--atom-mid), transparent 62%);
}

.atom-sphere i {
  position: absolute;
  inset: 0;
  display: block;
  border: inherit;
  border-radius: inherit;
  background: inherit;
  box-shadow: inherit;
  opacity: 0.36;
  transform-style: preserve-3d;
}

.atom-sphere i:nth-child(1) { transform: rotateY(55deg); }
.atom-sphere i:nth-child(2) { transform: rotateY(-55deg); }
.atom-sphere i:nth-child(3) { transform: rotateX(55deg); }
.atom-sphere i:nth-child(4) { transform: rotateX(-55deg); }
.atom-sphere i:nth-child(5) {
  opacity: 0.22;
  transform: rotateX(90deg) rotateY(90deg);
}

.crystal-node.surface { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; }
.crystal-node.core { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.crystal-node.ext-fe { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
.crystal-node.ext-o { width: 4.5px; height: 4.5px; margin: -2.25px 0 0 -2.25px; }

.crystal-node.surface span,
.crystal-node.ext-o span {
  --atom-light: rgba(186, 255, 239, 0.72);
  --atom-mid: rgba(0, 191, 166, 0.5);
  --atom-deep: rgba(13, 148, 136, 0.62);
  --atom-edge: rgba(13, 74, 68, 0.22);
}

.crystal-node.core span,
.crystal-node.ext-fe span {
  --atom-light: rgba(191, 229, 255, 0.72);
  --atom-mid: rgba(21, 136, 232, 0.55);
  --atom-deep: rgba(26, 54, 93, 0.68);
  --atom-edge: rgba(16, 32, 51, 0.24);
}

.crystal-node.core span {
  animation: core-fluid 3s infinite ease-in-out;
}

@keyframes core-fluid {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.16) brightness(1.06); }
}

.node-fe2 { transform: translate3d(0, 0, 0); }
.node-o6 { transform: translate3d(-0.6px, -23.4px, -0.6px); }
.node-o7 { transform: translate3d(23.4px, 0.6px, 0.6px); }
.node-o9 { transform: translate3d(-23.4px, -0.6px, -0.6px); }
.node-o10 { transform: translate3d(0.6px, 0.6px, 23.4px); }
.node-o12 { transform: translate3d(0.6px, 23.4px, 0.6px); }
.node-o13 { transform: translate3d(-0.6px, -0.6px, -23.4px); }
.node-fe0 { transform: translate3d(-36px, -36px, -36px); }
.node-fe1 { transform: translate3d(0, 24px, 24px); }
.node-fe3 { transform: translate3d(36px, 36px, 36px); }
.node-fe4 { transform: translate3d(24px, 24px, 0); }
.node-fe5 { transform: translate3d(24px, 0, 24px); }
.node-o8 { transform: translate3d(23.4px, 23.4px, 23.4px); }
.node-o11 { transform: translate3d(-23.4px, -23.4px, -23.4px); }

.brand-text {
  letter-spacing: 0;
}

.nav-links {
  gap: clamp(8px, 1.4vw, 22px);
  justify-content: center;
}

.nav-links a {
  padding: 8px 2px;
  color: #42546a;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--blue);
}

.header-actions {
  gap: 10px;
  justify-content: flex-end;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.language-toggle {
  color: #fff;
  background: linear-gradient(135deg, rgba(21, 136, 232, 0.72), rgba(0, 191, 166, 0.74));
  box-shadow: 0 12px 24px rgba(21, 136, 232, 0.16);
}

.hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.98fr) minmax(360px, 1.02fr);
  gap: clamp(38px, 5.5vw, 84px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(30px, 4.4vw, 56px) 6vw 54px;
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 216, 77, 0.34), transparent 24%),
    radial-gradient(circle at 70% 76%, rgba(0, 191, 166, 0.22), transparent 28%),
    radial-gradient(circle at 12% 22%, rgba(21, 136, 232, 0.15), transparent 30%),
    linear-gradient(135deg, #f7fdff 0%, #ffffff 48%, #effcff 100%);
}

.home-hero {
  border-bottom: 0;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding-top: clamp(28px, 3.6vw, 46px);
  padding-bottom: clamp(28px, 3.6vw, 46px);
}

.hero-copy {
  max-width: 760px;
  align-self: center;
}

.home-hero .hero-copy {
  transform: translateY(-14px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--aqua);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: none;
}

h1,
h2,
h3,
p,
span,
a,
button {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(4rem, 13vw, 9rem);
  line-height: 0.98;
  letter-spacing: 0;
  color: #0d2a44;
}

.home-hero h1 {
  display: inline-block;
  white-space: nowrap;
  font-size: clamp(3.8rem, 8.2vw, 7.2rem);
  line-height: 1.08;
  padding-bottom: 0.14em;
  color: transparent;
  background: linear-gradient(110deg, #0d2a44 0%, var(--blue) 42%, var(--aqua) 72%, #3e7cff 100%);
  background-clip: text;
}

.hero-tagline {
  margin: 22px 0 0;
  color: #174d6e;
  font-size: clamp(1.08rem, 1.65vw, 1.45rem);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.page-hero h1 {
  max-width: 100%;
  font-size: clamp(2.7rem, 4.8vw, 4.8rem);
  line-height: 1.02;
  overflow-wrap: normal;
  word-break: normal;
}

.visualisation-hero h1 {
  max-width: 100%;
  font-size: clamp(2.9rem, 5.2vw, 5rem);
  line-height: 1.06;
}

.hero-text,
.page-hero p,
.lead {
  color: #35445a;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-text {
  margin: 26px 0 0;
}

.hero-quote {
  position: relative;
  max-width: 760px;
  margin-top: 28px;
  padding-left: 22px;
  border-left: 4px solid rgba(0, 191, 166, 0.34);
  line-height: 1.58;
}

.hero-actions,
.element-actions,
.result-line,
.article-topline,
.article-meta,
.tag-list,
.record-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-actions {
  margin-top: 30px;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
  width: min(100%, 620px);
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid rgba(214, 228, 236, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(21, 136, 232, 0.12);
}

.hero-search input {
  min-height: 54px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.hero-search button {
  min-width: 108px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--aqua));
  font-weight: 900;
  cursor: pointer;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: min(100%, 680px);
  margin-top: 12px;
  color: #78909c;
  font-size: 0.88rem;
  font-weight: 800;
}

.search-suggestions span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  line-height: 1;
}

.search-suggestions a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(214, 228, 236, 0.92);
  border-radius: 999px;
  color: #263238;
  background: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.search-suggestions a:hover,
.search-suggestions a:focus-visible {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, rgba(0, 188, 212, 0.92), rgba(0, 191, 166, 0.92));
  box-shadow: 0 10px 22px rgba(0, 188, 212, 0.18);
  transform: translateY(-1px);
}

.primary-action,
.secondary-action,
#clear-filters,
#clear-elements {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--aqua));
  box-shadow: 0 14px 30px rgba(21, 136, 232, 0.22);
}

.secondary-action,
#clear-filters,
#clear-elements {
  border: 1px solid var(--line);
  color: #12334a;
  background: #fff;
}

.hero-metrics {
  position: relative;
  align-self: center;
  width: 100%;
  max-width: 600px;
  min-height: 330px;
  margin: 0 auto;
  transform: translateX(clamp(22px, 3vw, 42px));
}

.metric-bubble {
  --bubble-transform: translate(0, 0);
  --float-x: 8px;
  --float-y: -10px;
  position: absolute;
  display: grid;
  width: clamp(132px, 12.5vw, 172px);
  aspect-ratio: 1;
  place-content: center;
  justify-items: center;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #16304a;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.72), transparent 28%),
    radial-gradient(circle at 76% 82%, rgba(0, 191, 166, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.46), rgba(210, 247, 255, 0.24));
  text-align: center;
  box-shadow:
    0 22px 54px rgba(14, 102, 148, 0.14),
    inset 0 1px 8px rgba(255, 255, 255, 0.54),
    inset 0 -14px 30px rgba(21, 136, 232, 0.08);
  backdrop-filter: blur(26px) saturate(1.45);
  -webkit-backdrop-filter: blur(26px) saturate(1.45);
  animation: metric-float 7.8s ease-in-out infinite;
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 240ms ease, background 240ms ease;
}

.metric-bubble > * {
  position: relative;
  z-index: 1;
}

.metric-bubble:hover {
  animation: none;
  transform: var(--bubble-transform) translateY(-5px) scale(1.05);
  z-index: 30;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.82), transparent 30%),
    radial-gradient(circle at 76% 82%, rgba(0, 191, 166, 0.2), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(210, 247, 255, 0.3));
  box-shadow:
    0 28px 62px rgba(14, 102, 148, 0.18),
    inset 0 1px 10px rgba(255, 255, 255, 0.62),
    inset 0 -16px 32px rgba(21, 136, 232, 0.1);
}

.metric-bubble strong {
  display: block;
  width: 100%;
  color: var(--blue);
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1;
  text-align: center;
}

.metric-bubble span {
  display: block;
  max-width: 140px;
  color: #496078;
  font-weight: 850;
  text-align: center;
}

.metric-bubble.large {
  --bubble-transform: translate(-50%, -50%);
  --float-x: 0px;
  --float-y: -9px;
  width: clamp(190px, 18.5vw, 238px);
  top: 50%;
  left: 50%;
  z-index: 4;
  transform: var(--bubble-transform);
  animation-duration: 8.8s;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.42), transparent 26%),
    radial-gradient(circle at 78% 84%, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(21, 136, 232, 0.64), rgba(0, 191, 166, 0.58));
  color: #fff;
  box-shadow:
    0 26px 58px rgba(13, 148, 136, 0.2),
    inset 0 1px 10px rgba(255, 255, 255, 0.32),
    inset 0 -16px 34px rgba(7, 26, 85, 0.12);
}

.metric-bubble.large:hover {
  transform: var(--bubble-transform) translateY(-3px) scale(1.025);
  box-shadow:
    0 30px 66px rgba(14, 102, 148, 0.23),
    inset 0 1px 12px rgba(255, 255, 255, 0.36),
    inset 0 -18px 36px rgba(7, 26, 85, 0.14);
}

.metric-bubble.large strong,
.metric-bubble.large span {
  color: #fff;
}

.metric-bubble.large strong {
  font-size: clamp(2.15rem, 4.4vw, 3.45rem);
}

.metric-bubble:nth-child(3) strong {
  color: var(--violet);
}

.metric-bubble:nth-child(4) strong {
  color: var(--coral);
  font-size: clamp(1.55rem, 2.65vw, 2.35rem);
}

.metric-bubble:nth-child(2) {
  --float-x: -3px;
  --float-y: 7px;
  top: 0;
  left: 3%;
  z-index: 12;
  animation-duration: 7.2s;
  animation-delay: -1.3s;
}

.metric-bubble:nth-child(3) {
  --float-x: 9px;
  --float-y: 7px;
  top: 1%;
  right: 3%;
  z-index: 10;
  animation-duration: 8.4s;
  animation-delay: -2.1s;
}

.metric-bubble:nth-child(4) {
  --float-x: -7px;
  --float-y: -9px;
  right: 12%;
  bottom: -8%;
  z-index: 10;
  animation-duration: 7.6s;
  animation-delay: -3.4s;
}

@keyframes metric-float {
  0%,
  100% {
    transform: var(--bubble-transform) translate3d(0, 0, 0);
  }

  50% {
    transform: var(--bubble-transform) translate3d(var(--float-x), var(--float-y), 0);
  }
}

.section,
.page-hero {
  padding: 72px 6vw;
}

.page-hero.compact {
  min-height: 330px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 216, 77, 0.34), transparent 24%),
    radial-gradient(circle at 8% 86%, rgba(0, 191, 166, 0.16), transparent 28%),
    var(--mist);
}

body[data-page="visualization"] main {
  background:
    radial-gradient(circle at 12% 12%, rgba(0, 191, 166, 0.18), transparent 24%),
    radial-gradient(circle at 82% 4%, rgba(21, 136, 232, 0.12), transparent 26%),
    linear-gradient(180deg, #f1fbfd 0%, #f8fdff 34%, #ffffff 72%);
}

body[data-page="visualization"] .visualisation-hero {
  border-bottom: 0;
  background: transparent;
  padding-bottom: 48px;
}

body[data-page="visualization"] .visualisation-hero + .section {
  padding-top: 30px;
}

.page-hero p {
  max-width: min(100%, 1280px);
}

body[data-page="contact"] .page-hero p,
body[data-page="database"] .page-hero p,
body[data-page="visualization"] .page-hero p {
  width: fit-content;
  max-width: 100%;
  font-size: clamp(0.82rem, 1.28vw, 1.1rem);
  line-height: 1.5;
}

@media (min-width: 720px) {
  body[data-page="contact"] .page-hero p,
  body[data-page="database"] .page-hero p,
  body[data-page="visualization"] .page-hero p {
    white-space: nowrap;
  }
}

body[data-page="database"] .page-hero h1 {
  font-size: clamp(3rem, 5vw, 4.9rem);
}

body[data-page="visualization"] .visualisation-hero h1 {
  font-size: clamp(3rem, 5.4vw, 5.05rem);
}

body[data-page="contact"] .page-hero h1 {
  font-size: clamp(3.2rem, 5.8vw, 5rem);
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2,
.split-section h2,
.element-results h2,
.spec-panel h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.2vw, 3rem);
  line-height: 1.06;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(34px, 6vw, 82px);
  align-items: center;
}

.split-section > div:first-child {
  max-width: 760px;
}

.split-section h2 {
  max-width: 740px;
}

.quote-lead {
  position: relative;
  max-width: 760px;
  margin-top: 24px;
  padding-bottom: 46px;
  color: #8b949f;
  font-size: clamp(0.98rem, 1.18vw, 1.22rem);
  line-height: 1.72;
  font-weight: 400;
}

.quote-lead::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 104px;
  height: 5px;
  border-radius: 999px;
  background: #e5ebf0;
}

.assistant-layout {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
}

.assistant-layout > * {
  min-width: 0;
}

.mcp-connection-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(24px, 3vw, 36px);
}

.mcp-connection-layout > div:first-child {
  max-width: none;
}

.mcp-connection-layout .spec-panel {
  display: grid;
  align-content: start;
  min-height: clamp(420px, 42vw, 560px);
}

.mcp-connection-layout .guide-panel h2 {
  font-size: clamp(1.7rem, 3.2vw, 3rem);
}

.mcp-connection-layout .spec-panel pre {
  max-height: 330px;
  overflow: auto;
}

.mcp-integrity-note {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mcp-integrity-note h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
}

.mcp-integrity-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-card,
.article-card,
.spec-panel,
.upload-panel,
.table-panel,
.contact-form,
.element-results,
.gallery figure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.feature-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 142px;
  padding: 20px;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(21, 136, 232, 0.09);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 191, 166, 0.45);
  box-shadow: 0 18px 40px rgba(0, 191, 166, 0.14);
}

.feature-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  color: var(--cyan);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: color 160ms ease, transform 160ms ease;
}

.feature-icon-blue {
  color: var(--deep-blue);
}

.feature-card:hover .feature-icon {
  color: var(--cyan);
  transform: translateY(-1px);
}

.feature-card strong {
  font-size: 1.1rem;
}

.feature-card span,
.article-meta,
.site-footer,
.result-line,
.file-drop span,
.clean-list {
  color: var(--muted);
}

.image-band {
  background:
    linear-gradient(180deg, #ffffff, #f2fbff);
}

.image-band img,
.gallery img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 16%, rgba(255, 216, 77, 0.18), transparent 20%),
    radial-gradient(circle at 86% 72%, rgba(0, 191, 166, 0.13), transparent 26%),
    linear-gradient(180deg, #ffffff, #f6fdff);
}

.timeline-heading {
  max-width: 1280px;
}

.timeline-heading h2 {
  font-size: clamp(1.7rem, 3.2vw, 3rem);
  white-space: nowrap;
}

.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 42px);
  align-items: center;
  min-height: 470px;
  margin-top: 38px;
  padding: 18px 0;
}

.timeline-track::before,
.timeline-track::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 7%;
  left: 7%;
  height: 10px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.timeline-track::before {
  background: rgba(222, 238, 245, 0.82);
}

.timeline-track::after {
  background: linear-gradient(90deg, rgba(128, 222, 234, 0.55), rgba(0, 191, 166, 0.62), rgba(21, 136, 232, 0.72), #1a237e);
  box-shadow: 0 12px 30px rgba(21, 136, 232, 0.14);
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  transition: transform 1100ms cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-track.is-visible::after {
  transform: translateY(-50%) scaleX(1);
}

.timeline-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(178px, auto) 88px minmax(178px, auto);
  align-items: center;
  justify-items: center;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.timeline-track.is-visible .timeline-item {
  opacity: 1;
  transform: translateY(0);
}

.timeline-track.is-visible .timeline-item:nth-child(1) {
  transition-delay: 180ms;
}

.timeline-track.is-visible .timeline-item:nth-child(2) {
  transition-delay: 430ms;
}

.timeline-track.is-visible .timeline-item:nth-child(3) {
  transition-delay: 680ms;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: 46px;
  border-radius: 99px;
  background: repeating-linear-gradient(180deg, rgba(120, 144, 156, 0.45) 0 3px, transparent 3px 7px);
  transform: translateX(-50%) scaleX(0.5);
  opacity: 0.85;
}

.timeline-item-top::before {
  top: calc(50% - 92px);
}

.timeline-item-bottom::before {
  bottom: calc(50% - 92px);
}

.timeline-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
  width: min(100%, 330px);
  min-height: 190px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(214, 228, 236, 0.95);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  box-shadow: 0 14px 34px rgba(21, 136, 232, 0.08);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.timeline-card[data-citation]::after {
  content: attr(data-citation);
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  color: #1a237e;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.timeline-card[data-citation] {
  padding-bottom: 62px;
}

.timeline-card[data-citation]:hover::after,
.timeline-card[data-citation]:focus-visible::after {
  opacity: 0.34;
  transform: translateY(0);
}

.timeline-card:hover,
.timeline-card:focus-visible,
.timeline-card.is-active {
  transform: translateY(-6px) scale(1.025);
  border-color: rgba(0, 191, 166, 0.58);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(234, 255, 249, 0.98));
  box-shadow: 0 24px 52px rgba(0, 191, 166, 0.16);
}

.timeline-item-top .timeline-card {
  grid-row: 1;
}

.timeline-item-top .timeline-node {
  grid-row: 2;
}

.timeline-item-bottom .timeline-node {
  grid-row: 2;
}

.timeline-item-bottom .timeline-card {
  grid-row: 3;
}

.timeline-year {
  width: max-content;
  padding: 3px 9px;
  border-radius: 999px;
  color: #0a6d61;
  background: rgba(0, 191, 166, 0.12);
  font-weight: 950;
}

.timeline-card strong {
  color: #12334a;
  font-size: 1.1rem;
}

.timeline-card span:last-child {
  color: var(--muted);
}

.timeline-node {
  position: relative;
  z-index: 3;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(227, 250, 255, 0.72));
  box-shadow:
    0 18px 42px rgba(21, 136, 232, 0.16),
    inset 0 1px 8px rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.timeline-node:hover {
  transform: translateY(-5px) scale(1.06);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.96), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(219, 250, 255, 0.78));
  box-shadow:
    0 24px 52px rgba(21, 136, 232, 0.2),
    0 0 0 7px rgba(128, 222, 234, 0.14),
    inset 0 1px 10px rgba(255, 255, 255, 0.78);
}

.timeline-node::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 0 0 1px rgba(128, 222, 234, 0.24);
}

.timeline-item:has(.timeline-card.is-active) .timeline-node {
  box-shadow:
    0 20px 46px rgba(21, 136, 232, 0.22),
    0 0 0 8px rgba(128, 222, 234, 0.18),
    inset 0 1px 8px rgba(255, 255, 255, 0.76);
}

.timeline-node-particle {
  overflow: visible;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.9), transparent 26%),
    linear-gradient(145deg, rgba(245, 252, 255, 0.92), rgba(220, 247, 252, 0.72));
}

.timeline-node-particle::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 15px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #80deea;
  box-shadow:
    0 0 0 5px rgba(128, 222, 234, 0.16),
    0 0 22px rgba(0, 191, 166, 0.5);
  animation: active-core-pulse 2.4s ease-in-out infinite;
}

.timeline-crystal-canvas {
  display: block;
  width: 74px;
  height: 74px;
  filter: drop-shadow(0 9px 14px rgba(26, 35, 126, 0.18));
  transition: transform 180ms ease, filter 180ms ease;
}

.timeline-node-particle:hover .timeline-crystal-canvas {
  transform: translateY(-4px) scale(1.08) rotate(-4deg);
  filter: drop-shadow(0 13px 18px rgba(26, 35, 126, 0.24));
}

.activation-ray {
  position: absolute;
  top: 20px;
  right: 7px;
  width: 28px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(128, 222, 234, 0), rgba(0, 191, 166, 0.88));
  transform-origin: right center;
  opacity: 0.72;
  animation: activation-ray 2.4s ease-in-out infinite;
}

.activation-ray:nth-of-type(1) {
  transform: rotate(-32deg);
  animation-delay: 160ms;
}

.activation-ray:nth-of-type(2) {
  transform: rotate(12deg);
  animation-delay: 320ms;
}

.activation-ray:nth-of-type(3) {
  transform: rotate(45deg);
  animation-delay: 480ms;
}

@keyframes active-core-pulse {
  0%,
  100% {
    transform: scale(0.88);
    opacity: 0.72;
  }

  50% {
    transform: scale(1.16);
    opacity: 1;
  }
}

@keyframes activation-ray {
  0%,
  100% {
    opacity: 0.22;
    scale: 0.65 1;
  }

  50% {
    opacity: 0.86;
    scale: 1 1;
  }
}

.timeline-node-materials {
  overflow: visible;
}

.carbon-grid {
  position: absolute;
  bottom: 13px;
  left: 13px;
  width: 45px;
  height: 28px;
  opacity: 0.82;
  background:
    linear-gradient(30deg, transparent 47%, rgba(26, 35, 126, 0.62) 48% 51%, transparent 52%),
    linear-gradient(150deg, transparent 47%, rgba(26, 35, 126, 0.62) 48% 51%, transparent 52%),
    linear-gradient(90deg, transparent 47%, rgba(26, 35, 126, 0.42) 48% 51%, transparent 52%);
  background-size: 18px 15px;
  transform: skewX(-14deg) rotate(-4deg);
  transition: transform 180ms ease, opacity 180ms ease;
}

.carbon-grid::before,
.carbon-grid::after {
  content: "";
  position: absolute;
  inset: 4px 6px;
  border: 2px solid rgba(26, 35, 126, 0.58);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

.carbon-grid::after {
  inset: 4px 20px 4px -8px;
}

.mof-cube {
  position: absolute;
  top: 16px;
  left: 22px;
  width: 26px;
  height: 26px;
  border: 2px solid #1a237e;
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 12px rgba(26, 35, 126, 0.16));
  transition: transform 180ms ease, filter 180ms ease;
}

.timeline-node-materials:hover .carbon-grid {
  opacity: 0.95;
  transform: translate(-2px, 3px) skewX(-14deg) rotate(-4deg);
}

.timeline-node-materials:hover .mof-cube {
  transform: translate(3px, -8px) scale(1.08);
  filter: drop-shadow(0 12px 16px rgba(26, 35, 126, 0.22));
}

.mof-cube::before,
.mof-cube::after {
  content: "";
  position: absolute;
}

.mof-cube::before {
  top: -9px;
  left: 8px;
  width: 26px;
  height: 26px;
  border: 2px solid #1a237e;
  background:
    linear-gradient(135deg, transparent 47%, rgba(26, 35, 126, 0.82) 48% 52%, transparent 53%);
}

.mof-cube::after {
  inset: -9px -10px 0 0;
  background:
    linear-gradient(135deg, transparent 48%, #1a237e 49% 51%, transparent 52%),
    linear-gradient(135deg, transparent 48%, #1a237e 49% 51%, transparent 52%),
    linear-gradient(135deg, transparent 48%, #1a237e 49% 51%, transparent 52%),
    linear-gradient(135deg, transparent 48%, #1a237e 49% 51%, transparent 52%);
  background-position:
    0 0,
    26px 0,
    0 26px,
    26px 26px;
  background-size: 10px 10px;
  background-repeat: no-repeat;
  opacity: 0.95;
}

.timeline-node-funnel {
  overflow: visible;
}

.funnel-body {
  position: absolute;
  top: 18px;
  left: 15px;
  width: 42px;
  height: 37px;
  background: transparent;
  filter: drop-shadow(0 6px 10px rgba(26, 35, 126, 0.15));
  transition: transform 180ms ease, filter 180ms ease;
}

.funnel-body span {
  position: absolute;
  display: block;
  border-radius: 99px;
  background: transparent;
}

.funnel-body span:nth-child(1) {
  top: 0;
  left: 0;
  width: 42px;
  height: 8px;
  border: 3px solid #1a237e;
}

.funnel-body span:nth-child(2),
.funnel-body span:nth-child(3) {
  top: 7px;
  width: 3px;
  height: 23px;
  transform-origin: top center;
  background: #1a237e;
}

.funnel-body span:nth-child(2) {
  left: 4px;
  transform: rotate(-37deg);
}

.funnel-body span:nth-child(3) {
  right: 4px;
  transform: rotate(37deg);
}

.funnel-body span:nth-child(4) {
  bottom: 0;
  left: 17px;
  width: 8px;
  height: 12px;
  border: 3px solid #1a237e;
  border-top: 0;
  background: transparent;
}

.funnel-chip {
  position: absolute;
  top: 21px;
  left: 25px;
  width: 22px;
  height: 6px;
  border-radius: 3px;
  background:
    radial-gradient(circle at 20% 50%, #1a237e 0 2px, transparent 2.5px),
    radial-gradient(circle at 80% 50%, #00bfa6 0 2px, transparent 2.5px),
    linear-gradient(135deg, transparent 42%, rgba(26, 35, 126, 0.82) 43% 49%, transparent 50%),
    linear-gradient(45deg, transparent 45%, rgba(0, 191, 166, 0.78) 46% 52%, transparent 53%);
  box-shadow: 0 0 0 1px rgba(26, 35, 126, 0.18), 0 0 14px rgba(0, 191, 166, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.funnel-output {
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #00bfa6;
  box-shadow:
    0 0 0 4px rgba(0, 191, 166, 0.12),
    0 0 16px rgba(0, 191, 166, 0.48);
  transform: translateX(-50%);
  animation: purified-output 2.6s ease-in-out infinite;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.funnel-particle {
  position: absolute;
  top: 9px;
  width: 8px;
  height: 8px;
  border: 2px solid rgba(120, 144, 156, 0.72);
  opacity: 0.82;
  animation: funnel-particle-drift 3.2s ease-in-out infinite;
  transition: transform 180ms ease, opacity 180ms ease;
}

.timeline-node-funnel:hover .funnel-body {
  transform: translateY(-5px) scale(1.06);
  filter: drop-shadow(0 12px 16px rgba(26, 35, 126, 0.22));
}

.timeline-node-funnel:hover .funnel-chip {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 0 1px rgba(26, 35, 126, 0.22), 0 0 18px rgba(0, 191, 166, 0.28);
}

.timeline-node-funnel:hover .funnel-output {
  transform: translateX(-50%) translateY(4px) scale(1.12);
  box-shadow:
    0 0 0 5px rgba(0, 191, 166, 0.14),
    0 0 20px rgba(0, 191, 166, 0.6);
}

.timeline-node-funnel:hover .funnel-particle {
  opacity: 1;
}

.funnel-particle:nth-child(1) {
  left: 15px;
  border-radius: 999px;
}

.funnel-particle:nth-child(2) {
  left: 28px;
  width: 10px;
  height: 7px;
  border-radius: 99px;
  animation-delay: 220ms;
}

.funnel-particle:nth-child(3) {
  left: 43px;
  border-radius: 2px;
  rotate: 15deg;
  animation-delay: 460ms;
}

.funnel-particle:nth-child(4) {
  top: 5px;
  left: 36px;
  width: 8px;
  height: 8px;
  border: 2px solid rgba(120, 144, 156, 0.72);
  background: transparent;
  rotate: 45deg;
  animation-delay: 680ms;
}

@keyframes funnel-particle-drift {
  0%,
  100% {
    transform: translateY(-2px);
    opacity: 0.45;
  }

  50% {
    transform: translateY(5px);
    opacity: 0.9;
  }
}

@keyframes purified-output {
  0%,
  100% {
    scale: 0.9;
    opacity: 0.78;
  }

  50% {
    scale: 1.18;
    opacity: 1;
  }
}

.nanozyme-intro {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 216, 77, 0.18), transparent 22%),
    linear-gradient(180deg, #ffffff, #f2fbff);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.info-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(239, 252, 255, 0.92));
  box-shadow: 0 14px 32px rgba(21, 136, 232, 0.08);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.info-card:hover {
  transform: translateY(-3px);
  border-color: rgba(21, 136, 232, 0.36);
  box-shadow: 0 22px 44px rgba(21, 136, 232, 0.14);
}

.info-card strong {
  display: block;
  color: var(--blue);
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.info-card p {
  margin: 0;
  color: var(--muted);
}

.toolbar {
  display: grid;
  gap: 12px;
  align-items: end;
}

.database-toolbar {
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 250px) minmax(140px, 190px) minmax(140px, 190px);
}

.search-box,
.select-box,
.form-grid label,
.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

textarea {
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(47, 128, 199, 0.23);
  outline-offset: 2px;
}

.result-line {
  justify-content: space-between;
  margin: 20px 0 16px;
}

.article-list {
  display: grid;
  gap: 14px;
}

.article-card {
  padding: 30px;
  box-shadow: 0 12px 28px rgba(21, 136, 232, 0.08);
}

.article-topline {
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 16px;
}

.article-topline .doi-link {
  flex: 0 0 auto;
}

.article-title {
  margin: 0;
  max-width: 1120px;
  font-size: clamp(1.05rem, 1.35vw, 1.32rem);
  line-height: 1.36;
}

.article-title a {
  color: var(--ink);
  text-decoration: none;
}

.article-title a:hover,
.doi-link {
  color: var(--blue);
}

.doi-link {
  font-weight: 850;
  text-decoration: none;
}

.doi-link:hover {
  text-decoration: underline;
}

.article-meta {
  margin: 8px 0 12px;
  font-size: 0.9rem;
}

.article-card .tag-list {
  align-items: flex-start;
  gap: 14px 16px;
  margin: 18px 0 20px;
  max-width: 1120px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid #cfe4ef;
  border-radius: 99px;
  color: #344255;
  background: #f3fbff;
  font-size: 0.82rem;
  font-weight: 800;
}

.pill.element {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 0.82rem;
  border-color: #cfe9f7;
  background: #f5fcff;
}

.pill.gold {
  border-color: rgba(255, 216, 77, 0.75);
  color: #765300;
  background: rgba(255, 216, 77, 0.22);
}

.pill.red {
  border-color: rgba(184, 69, 69, 0.28);
  color: #8e3434;
  background: rgba(184, 69, 69, 0.08);
}

.record-chip {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(0, 191, 166, 0.16);
  border-radius: 8px;
  color: #2b394b;
  background: #eaf9f6;
  font-size: 0.9rem;
  cursor: pointer;
}

.record-chip strong {
  font-size: 0.98rem;
  line-height: 1.32;
}

.record-chip small {
  color: var(--muted);
  line-height: 1.55;
}

.record-chip:hover {
  border-color: rgba(21, 136, 232, 0.35);
  background: #eef8ff;
}

.record-list {
  align-items: stretch;
  gap: 14px;
}

.type-summary {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.type-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-filter-list.grouped {
  display: grid;
  gap: 12px;
}

.type-group {
  display: grid;
  gap: 5px;
}

.type-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border-left: 4px solid var(--line);
  background: #f6f8fa;
  color: #26364a;
  font-weight: 900;
  line-height: 1.15;
}

.type-group-title em,
.type-filter em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.type-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #12334a;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.15;
  cursor: pointer;
}

.type-filter.subtype {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--blue);
  text-align: left;
}

.type-filter.is-selected {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--aqua));
}

.type-filter.is-selected em {
  color: #fff;
}

.record-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 51, 0.42);
}

.detail-dialog {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(1120px, calc(100vw - 34px));
  max-height: calc(100vh - 34px);
  margin: 17px auto;
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: #f7fafd;
  box-shadow: 0 22px 64px rgba(16, 32, 51, 0.22);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.detail-header h2 {
  margin: 0;
  color: var(--deep-blue);
  font-size: clamp(1.45rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.detail-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--coral);
  font-weight: 900;
  cursor: pointer;
}

.detail-source {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(214, 228, 236, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.highlight-ribbon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(26, 35, 126, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.06), rgba(255, 255, 255, 0.86));
}

.highlight-item {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid rgba(214, 228, 236, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.highlight-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.highlight-item strong {
  color: var(--deep-blue);
  font-size: clamp(0.95rem, 1.25vw, 1.18rem);
  line-height: 1.32;
  overflow-wrap: anywhere;
  word-break: normal;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 18px;
}

.synthesis-section {
  grid-column: 1 / -1;
}

.detail-section {
  padding: 20px;
  border: 1px solid rgba(214, 228, 236, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(16, 32, 51, 0.05);
}

.detail-section h3 {
  margin: 0 0 10px;
  color: var(--deep-blue);
}

.detail-section dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-section dl div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(214, 228, 236, 0.7);
}

.protocol-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.protocol-stepper li {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(214, 228, 236, 0.8);
  border-radius: 8px;
  background: #fbfdff;
}

.protocol-stepper li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 188, 212, 0.8);
  font-size: 0.82rem;
  font-weight: 900;
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.protocol-stepper li:hover span {
  background: linear-gradient(135deg, rgba(0, 188, 212, 0.86), rgba(0, 191, 166, 0.92));
  box-shadow: 0 8px 18px rgba(0, 188, 212, 0.24);
  transform: translateY(-1px);
}

.protocol-stepper li p,
.raw-protocol p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.synthesis-meta {
  margin-top: 14px;
}

.raw-protocol {
  margin-top: 14px;
  color: var(--muted);
}

.raw-protocol summary {
  cursor: pointer;
  color: var(--deep-blue);
  font-weight: 900;
}

.microviz-stack {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.microviz {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(214, 228, 236, 0.78);
  border-radius: 8px;
  background: #fbfdff;
}

.microviz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.microviz-top span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.microviz-top strong {
  color: var(--deep-blue);
}

.microviz-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(16, 32, 51, 0.08);
}

.ph-track {
  background: linear-gradient(90deg, #e85d75 0%, #f2c94c 35%, #56c596 50%, #3f7fcf 100%);
}

.temp-track {
  background: linear-gradient(90deg, #79c7e3 0%, #9bd78f 38%, #f0c75e 68%, #e76f51 100%);
}

.microviz-track i {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 5px 14px rgba(0, 188, 212, 0.36);
  transform: translate(-50%, -50%);
}

.kinetic-section dd {
  font-weight: 650;
}

.detail-section dt {
  color: #78909c;
  font-size: 0.84rem;
  font-weight: 650;
}

.detail-section dd {
  margin: 0;
  color: #263238;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.empty-value {
  color: #b0bec5;
  font-style: italic;
  font-weight: 400;
}

.detail-section sup {
  font-size: 0.72em;
  line-height: 0;
}

.data-warning {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 184, 77, 0.55);
  border-radius: 999px;
  color: #8a5a00;
  background: rgba(255, 216, 77, 0.18);
  font-size: 0.78rem;
  font-weight: 850;
  vertical-align: middle;
}

body.has-modal {
  overflow: hidden;
}

.empty-state {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.element-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.32fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.element-actions {
  justify-content: space-between;
  margin-bottom: 16px;
}

.periodic-table {
  display: grid;
  grid-template-columns: repeat(18, minmax(42px, 1fr));
  gap: 5px;
  overflow-x: visible;
  padding-bottom: 8px;
}

.element-button {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  aspect-ratio: 1 / 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1f2b3d;
  background: #fff;
  cursor: pointer;
}

.element-button strong {
  display: block;
  font-size: clamp(0.78rem, 0.95vw, 0.95rem);
  line-height: 1;
  white-space: nowrap;
}

.element-button span {
  display: block;
  color: var(--muted);
  font-size: clamp(0.52rem, 0.62vw, 0.62rem);
  line-height: 1;
}

.element-button.has-data {
  border-color: rgba(0, 191, 166, 0.42);
  background: #eafff9;
}

.element-button.is-selected {
  color: #fff;
  border-color: var(--blue);
  background: linear-gradient(135deg, var(--blue), var(--aqua));
  box-shadow: 0 10px 20px rgba(21, 136, 232, 0.22);
}

.element-button.is-selected span {
  color: rgba(255, 255, 255, 0.8);
}

.element-results {
  position: sticky;
  top: 96px;
  padding: 22px;
}

#element-result-count {
  white-space: nowrap;
}

.element-results-link {
  width: 100%;
  margin: 8px 0 16px;
}

.compact-list .article-card {
  padding: 14px;
}

.compact-list .record-list {
  display: none;
}

.upload-layout,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 28px;
  align-items: start;
}

.single-record-layout {
  display: block;
}

.single-record-layout .upload-panel {
  max-width: 1120px;
  margin: 0 auto;
}

.contribute-workflow {
  padding-top: 56px;
  padding-bottom: 44px;
  background: #ffffff;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mode-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(21, 136, 232, 0.07);
}

.mode-card input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--aqua);
}

.mode-card strong {
  font-size: 1.1rem;
}

.mode-card span,
.key-panel p {
  color: var(--muted);
}

.mode-card.is-selected {
  border-color: rgba(0, 191, 166, 0.62);
  background: linear-gradient(145deg, #effffa, #ffffff);
  box-shadow: 0 18px 38px rgba(0, 191, 166, 0.13);
}

.privacy-callout,
.key-panel,
.validation-message {
  border-radius: 8px;
}

.privacy-callout {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 216, 77, 0.75);
  background: rgba(255, 216, 77, 0.18);
}

.privacy-callout p {
  margin: 6px 0 0;
  color: #5d4a13;
}

.key-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 107, 87, 0.38);
  background: #fff8f5;
}

.key-panel[hidden] {
  display: none;
}

.key-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.agent-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.agent-step {
  display: grid;
  gap: 4px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.agent-step strong {
  color: var(--blue);
}

.agent-step span {
  color: var(--muted);
  font-size: 0.9rem;
}

.agent-step.is-ready {
  border-color: rgba(21, 136, 232, 0.42);
  background: linear-gradient(145deg, #eff8ff, #f0fffb);
}

.upload-panel,
.table-panel,
.contact-form,
.spec-panel {
  padding: 22px;
}

.file-drop {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 170px;
  padding: 22px;
  border: 1px dashed rgba(0, 191, 166, 0.62);
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fffb, #f7fcff);
  text-align: center;
  cursor: pointer;
}

.source-drop {
  min-height: 138px;
  margin-top: 14px;
  border-color: rgba(255, 107, 87, 0.55);
  background: linear-gradient(135deg, #fff7f3, #f4fffd);
}

.file-drop input {
  display: none;
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.source-empty,
.source-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.source-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.source-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
}

.source-item span {
  font-weight: 800;
}

.source-item small {
  grid-column: 1;
  color: var(--muted);
}

.source-item button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--coral);
  cursor: pointer;
}

.form-grid {
  display: grid;
  gap: 14px 18px;
  margin: 18px 0;
}

.field-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(21, 136, 232, 0.18);
  border-radius: 8px;
  color: #34546c;
  background: #f7fcff;
  font-size: 0.92rem;
  line-height: 1.55;
}

.contribution-field-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.contribution-field-grid label {
  min-width: 0;
  gap: 5px;
}

.contribution-field-grid label.field-wide {
  grid-column: span 2;
}

.contribution-field-grid input,
.contribution-field-grid textarea {
  min-height: 40px;
  padding: 8px 11px;
  line-height: 1.35;
}

.contribution-field-grid textarea {
  min-height: 40px;
  height: 40px;
  max-height: 132px;
  overflow-y: auto;
  resize: vertical;
}

.contribution-field-grid label.field-scroll textarea {
  min-height: 40px;
}

.upload-actions {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.upload-actions > .primary-action {
  width: 100%;
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.secondary-actions .secondary-action {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: none;
}

.editable-table-wrap {
  overflow: auto;
  max-height: 560px;
}

.validation-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.processing-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.processing-message {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbfd;
}

.processing-message.active {
  border-color: rgba(21, 136, 232, 0.34);
  color: #174d6e;
  background: linear-gradient(135deg, #eef8ff, #effffa);
}

.processing-message p {
  margin: 8px 0 12px;
}

.assistant-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  font-weight: 900;
  text-decoration: none;
}

.job-step-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.job-step-list li {
  color: #34546c;
}

.guide-command-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.guide-command-grid > div {
  padding: 16px;
  border: 1px solid rgba(21, 136, 232, 0.15);
  border-radius: 8px;
  background: #f8fcff;
}

.guide-command-grid h3 {
  margin: 0 0 10px;
  color: #123650;
  font-size: 1rem;
}

.guide-command-grid pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid rgba(6, 49, 82, 0.1);
  border-radius: 8px;
  background: #ffffff;
  white-space: pre-wrap;
}

.guide-command-grid code {
  font-size: 0.88rem;
  line-height: 1.55;
}

.guide-command-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.spec-panel > p {
  color: var(--muted);
  line-height: 1.65;
}

.clean-list li {
  display: grid;
  gap: 5px;
}

.clean-list li span {
  color: var(--muted);
  line-height: 1.5;
}

.api-section {
  display: grid;
  gap: 22px;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.api-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.api-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(21, 136, 232, 0.07);
}

.api-card h3 {
  margin: 0 0 8px;
  color: #10243a;
  font-size: 1.12rem;
}

.api-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.api-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.api-list div {
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(214, 228, 236, 0.75);
}

.api-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.api-list dt,
.api-list dd {
  margin: 0;
}

.api-list dd {
  color: var(--muted);
  line-height: 1.55;
}

.api-example {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #f8fcff, #fffaf2);
}

.api-example pre {
  margin: 0 0 12px;
  overflow-x: auto;
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
}

.api-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-pill-list li {
  padding: 8px 10px;
  border: 1px solid rgba(21, 136, 232, 0.18);
  border-radius: 999px;
  background: #f7fcff;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.assistant-workspace {
  display: grid;
  gap: 18px;
}

.chat-shell {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fcff, #fffafd);
}

.chat-log {
  display: grid;
  gap: 10px;
  max-height: 360px;
  min-height: 240px;
  overflow: auto;
  padding: 6px;
}

.chat-message {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.55;
}

.chat-message.assistant {
  justify-self: start;
  border: 1px solid rgba(21, 136, 232, 0.24);
  color: #123650;
  background: #ffffff;
}

.chat-message.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.assistant-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.assistant-prompts button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(21, 136, 232, 0.22);
  border-radius: 999px;
  color: #17649a;
  background: #f4fbff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.assistant-prompts button:hover {
  border-color: rgba(0, 191, 166, 0.42);
  color: #087766;
  background: #effffb;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-input-row input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
}

.validation-message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #f8fbfd;
}

.validation-message.ok {
  border-color: rgba(0, 191, 166, 0.42);
  color: #0e705f;
  background: #eafff9;
}

.validation-message.warn {
  border-color: rgba(255, 107, 87, 0.35);
  color: #98412f;
  background: #fff4ef;
}

.status-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding-left: 20px;
}

.status-list a {
  color: inherit;
  font-weight: 850;
}

.submitter-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.submitter-panel h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.submitter-panel p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.submitter-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.status-detail {
  display: block;
  margin-top: 8px;
  color: inherit;
  font-size: 0.86rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  opacity: 0.86;
}

.editable-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.editable-table th,
.editable-table td {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.editable-table th {
  position: sticky;
  top: 0;
  background: #fff;
}

.editable-table td[contenteditable="true"] {
  background: #fbfdff;
}

.spec-panel.dark {
  color: #eaf2f8;
  background:
    radial-gradient(circle at 90% 12%, rgba(255, 216, 77, 0.24), transparent 22%),
    linear-gradient(135deg, #12334a, #174d6e);
}

.spec-panel pre {
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  white-space: pre-wrap;
}

.clean-list {
  display: grid;
  gap: 12px;
  padding-left: 18px;
}

.guide-panel,
.setup-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.guide-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.guide-panel h2,
.setup-panel h2 {
  font-size: clamp(2rem, 4vw, 3.9rem);
  overflow-wrap: anywhere;
}

.guide-panel p,
.setup-panel p,
.guide-panel li,
.setup-panel li {
  overflow-wrap: anywhere;
  word-break: normal;
}

.setup-result {
  display: grid;
  gap: 8px;
}

.setup-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.setup-line span {
  font-weight: 900;
}

.setup-line small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.setup-line.ok {
  border-color: rgba(0, 191, 166, 0.34);
  background: #effffa;
}

.setup-line.warn {
  border-color: rgba(255, 216, 77, 0.48);
  background: #fffbed;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gallery figure {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 14px;
}

.gallery img {
  height: clamp(300px, 31vw, 520px);
  object-fit: contain;
  padding: 10px;
  cursor: zoom-in;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.gallery img:hover,
.gallery img:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(7, 26, 85, 0.28);
  box-shadow: 0 16px 38px rgba(16, 32, 51, 0.12);
  outline: none;
}

.gallery figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 51, 0.72);
  backdrop-filter: blur(10px);
}

.gallery-lightbox-dialog {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  width: min(1500px, calc(100vw - 38px));
  height: min(920px, calc(100vh - 38px));
  margin: 19px auto;
  padding: 18px;
  border: 1px solid rgba(214, 228, 236, 0.55);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(16, 32, 51, 0.3);
}

.gallery-lightbox-viewport {
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  cursor: zoom-in;
  touch-action: none;
}

.gallery-lightbox-viewport.is-zoomed {
  cursor: grab;
}

.gallery-lightbox-viewport.is-zoomed:active {
  cursor: grabbing;
}

.gallery-lightbox-dialog img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  user-select: none;
  transform-origin: center center;
  transition: transform 90ms ease-out;
  will-change: transform;
}

.gallery-lightbox-dialog p {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.gallery-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #071A55;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(7, 26, 85, 0.22);
}

.gallery-lightbox-controls {
  position: absolute;
  top: 12px;
  right: 58px;
  z-index: 1;
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(214, 228, 236, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(16, 32, 51, 0.14);
  backdrop-filter: blur(10px);
}

.gallery-lightbox-controls button {
  display: inline-flex;
  min-width: 38px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  color: #071A55;
  background: rgba(7, 26, 85, 0.08);
  font-weight: 900;
  cursor: pointer;
}

.gallery-lightbox-controls button:hover,
.gallery-lightbox-controls button:focus-visible {
  color: #fff;
  background: #071A55;
  outline: none;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form small {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.contact-output {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: #eefbff;
  overflow-wrap: anywhere;
}

.mail-draft-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  padding: 9px 13px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.mail-draft-link:hover,
.mail-draft-link:focus-visible {
  background: #071A55;
  outline: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 6vw;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, #eafff9, #eef8ff);
  font-size: 0.9rem;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .hero,
  .split-section,
  .mcp-connection-layout,
  .element-layout,
  .upload-layout,
  .contact-layout,
  .highlight-ribbon,
  .database-toolbar,
  .mode-grid,
  .agent-flow,
  .api-grid,
  .api-summary-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-metrics {
    min-height: 360px;
    transform: none;
  }

  .split-section .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-heading h2 {
    white-space: normal;
  }

  .element-results {
    position: static;
  }

  .contribution-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .crystal-core,
  .crystal-node span,
  .crystal-node.core span,
  .metric-bubble {
    animation: none;
  }

  .timeline-node-particle::after,
  .activation-ray,
  .funnel-particle,
  .funnel-output {
    animation: none;
  }

  .timeline-track::after,
  .timeline-item {
    transition: none;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 14px 18px;
  }

  .hero,
  .section,
  .page-hero {
    padding-right: 18px;
    padding-left: 18px;
  }

  h1 {
    font-size: clamp(3.2rem, 23vw, 5.8rem);
  }

  .home-hero h1 {
    font-size: clamp(3.4rem, 22vw, 5.6rem);
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .visualisation-hero h1 {
    font-size: clamp(2.4rem, 14vw, 4.4rem);
    line-height: 1.1;
  }

  .detail-grid,
  .detail-section dl div {
    grid-template-columns: 1fr;
  }

  .highlight-ribbon {
    grid-template-columns: 1fr;
  }

  .protocol-stepper li {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .split-section .feature-grid,
  .gallery,
  .info-grid,
  .api-grid,
  .api-summary-grid,
  .timeline-track {
    grid-template-columns: 1fr;
  }

  .gallery img {
    height: clamp(240px, 68vw, 420px);
  }

  .timeline-track::before {
    top: 28px;
    right: auto;
    bottom: 28px;
    left: 36px;
    width: 6px;
    height: auto;
    transform: none;
  }

  .timeline-track::after {
    top: 28px;
    right: auto;
    bottom: 28px;
    left: 36px;
    width: 6px;
    height: auto;
    background: linear-gradient(180deg, rgba(128, 222, 234, 0.55), rgba(0, 191, 166, 0.62), rgba(21, 136, 232, 0.72), #1a237e);
    transform: scaleY(0);
    transform-origin: top center;
  }

  .timeline-track.is-visible::after {
    transform: scaleY(1);
  }

  .timeline-track {
    gap: 24px;
    min-height: 0;
    padding: 18px 0 18px 4px;
  }

  .timeline-card {
    min-height: 0;
    width: 100%;
  }

  .timeline-item,
  .timeline-item-top,
  .timeline-item-bottom {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    justify-items: stretch;
  }

  .timeline-item::before {
    display: block;
    top: 50%;
    left: 58px;
    width: 18px;
    height: 1px;
    background: repeating-linear-gradient(90deg, rgba(120, 144, 156, 0.42) 0 3px, transparent 3px 7px);
    transform: translateY(-50%) scaleY(0.5);
  }

  .timeline-item-top .timeline-card,
  .timeline-item-bottom .timeline-card {
    grid-row: 1;
    grid-column: 2;
  }

  .timeline-item-top .timeline-node,
  .timeline-item-bottom .timeline-node {
    grid-row: 1;
    grid-column: 1;
    width: 58px;
    height: 58px;
  }

  .timeline-crystal-canvas {
    width: 60px;
    height: 60px;
  }

  .timeline-node-funnel {
    transform: scale(0.88);
  }

  .hero-search {
    grid-template-columns: 1fr;
  }

  .hero-search button {
    min-height: 48px;
  }

  .hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-height: 0;
  }

  .metric-bubble,
  .metric-bubble.large,
  .metric-bubble:nth-child(2),
  .metric-bubble:nth-child(3),
  .metric-bubble:nth-child(4) {
    position: static;
    width: 100%;
    height: auto;
    min-height: 132px;
    animation: none;
    transform: none;
  }

  .periodic-table {
    grid-template-columns: repeat(9, minmax(40px, 1fr));
  }

  .chat-message {
    max-width: 100%;
  }

  .chat-input-row {
    grid-template-columns: 1fr;
  }

  .contribution-field-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .contribution-field-grid label.field-wide {
    grid-column: auto;
  }
}
