:root {
  --ink: #1c2429;
  --muted: #52606d;
  --paper: #f7f1e8;
  --panel: #fffaf3;
  --line: #e2d6c5;
  --copper: #c45c26;
  --teal: #2f6f6a;
  --navy: #1f3a5f;
  --shadow: 0 18px 40px rgba(28, 36, 41, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Source Sans Pro", sans-serif;
  background:
    radial-gradient(1100px 480px at 8% -8%, rgba(196, 92, 38, 0.14), transparent 55%),
    radial-gradient(800px 400px at 92% 0%, rgba(47, 111, 106, 0.12), transparent 50%),
    linear-gradient(180deg, #f3ebe0 0%, #f7f1e8 42%, #efe6d8 100%);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.hero.compact {
  background: linear-gradient(128deg, #1f3a5f 0%, #2f6f6a 58%, #c45c26 150%);
  color: #f8f4ee;
  border-radius: 20px;
  padding: 22px 24px 18px;
  box-shadow: var(--shadow);
  animation: hero-in 0.55s ease-out;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.72rem;
  opacity: 0.85;
}

.hero h1 {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  max-width: 58ch;
  font-size: 0.98rem;
  opacity: 0.95;
  line-height: 1.45;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badges a {
  display: inline-flex;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}

.badges a:hover {
  background: rgba(255, 255, 255, 0.24);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.8);
  color: var(--navy);
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  border-color: var(--teal);
}

.tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(28, 36, 41, 0.06);
  animation: panel-in 0.28s ease-out;
}

.panel.active {
  display: block;
}

@keyframes panel-in {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

.stage {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .stage {
    grid-template-columns: 1fr;
  }
}

.stage-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.stage-head h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  color: var(--navy);
  font-weight: 600;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}

label.inline select {
  width: auto;
  min-width: 140px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
}

.stage-mol {
  flex: 1;
  min-height: 420px;
  height: 420px;
}

.stage-plot {
  flex: 1;
  min-height: 420px;
}

.caption {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 5px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--navy);
}

select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

label.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  font-size: 0.88rem;
  color: var(--ink);
  padding-top: 16px;
}

label.check input {
  width: auto;
  margin: 0;
}

.note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3ebe0;
  border: 1px solid var(--line);
  color: var(--muted);
}

.note.slim {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.text-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--copper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.panel-subhead {
  margin: 14px 0 6px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--navy);
}

.plot {
  width: 100%;
  min-height: 380px;
  border-radius: 14px;
  overflow: hidden;
  background: #fbf7f1;
  border: 1px solid var(--line);
}

.plot.compact-plot {
  min-height: 280px;
}

.refine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 860px) {
  .refine-grid {
    grid-template-columns: 1fr;
  }
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  background: #fff;
  max-height: 340px;
}

.table-wrap h3 {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th,
td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f3ebe0;
  color: var(--navy);
}

td a {
  color: var(--copper);
  font-weight: 600;
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.chip {
  background: #f3ebe0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.86rem;
  color: var(--navy);
  font-weight: 600;
}

.paper-card h2 {
  font-family: Fraunces, Georgia, serif;
  margin-top: 0;
  font-size: 1.35rem;
}

.paper-card a {
  color: var(--copper);
}

.paper-card ul {
  color: var(--muted);
  line-height: 1.5;
}

.bibtex {
  background: #1f3a5f;
  color: #f7f1e8;
  border-radius: 14px;
  padding: 14px 16px;
  overflow: auto;
  font-size: 0.84rem;
  line-height: 1.45;
}

footer {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

footer a {
  color: var(--copper);
  font-weight: 600;
  text-decoration: none;
}

.skeleton-msg {
  margin: 0;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.mol-view {
  width: 100%;
  min-height: 340px;
  height: 340px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #102033;
  position: relative;
  overflow: hidden;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.data-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}

.data-card h3 {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  color: var(--navy);
}

.data-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.data-card a {
  color: var(--copper);
  font-weight: 600;
  text-decoration: none;
}

.data-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink);
}
