:root {
  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-surface-alt: #dff2d8;
  --app-border: #cccccc;
  --app-text: #14212b;
  --app-muted: #6b6b7b;
  --app-primary: #564d80;
  --app-secondary: #98a6d4;
  --app-accent: #9fc490;
  --app-brand-dark: #44344f;
  --app-mint: #dff2d8;
  --app-shadow: 0 16px 40px rgba(68, 52, 79, 0.09);
  --app-shadow-soft: 0 10px 28px rgba(68, 52, 79, 0.06);
}

html,
body {
  background: var(--app-bg);
  color: var(--app-text);
}

body {
  letter-spacing: -0.01em;
}

.navbar {
  background: var(--app-brand-dark) !important;
  backdrop-filter: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(68, 52, 79, 0.18);
}

.navbar > .container-fluid,
.navbar > .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.45rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.navbar-brand {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  margin-right: 0;
  margin-bottom: 0.1rem;
}

.app-navbar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  line-height: 1.1;
  text-align: left;
}

.app-navbar-brand > span:first-child {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.navbar-collapse {
  width: 100%;
  justify-content: flex-start;
}

.navbar-nav {
  margin: 0;
  align-items: flex-start;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.78) !important;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.55rem 0.95rem !important;
  margin: 0 0.15rem;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(86, 77, 128, 0.02);
  transition: transform 0.18s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: #ffffff !important;
  background: rgba(152, 166, 212, 0.22);
  border-color: rgba(152, 166, 212, 0.30);
  box-shadow: 0 2px 8px rgba(68, 52, 79, 0.12);
  transform: translateY(-1px);
}

.navbar-nav .active > .nav-link,
.navbar-nav .nav-link.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #564d80 0%, #6b5fa0 100%);
  border-color: rgba(86, 77, 128, 0.45);
  box-shadow: 0 1px 2px rgba(68, 52, 79, 0.12), 0 6px 14px rgba(86, 77, 128, 0.22);
}

.container-fluid {
  padding: 1.5rem;
}

.explorer-page {
  padding: 0.5rem 0 1.5rem;
}

.explorer-header {
  margin-bottom: 1.15rem;
}

.explorer-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--app-text);
}

.explorer-subtitle {
  margin: 0.45rem 0 0;
  max-width: 68rem;
  color: var(--app-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.bslib-sidebar-layout {
  gap: 1.25rem;
  align-items: flex-start;
}

.explorer-sidebar.sidebar {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  box-shadow: var(--app-shadow-soft);
  padding: 0.55rem 1rem 1rem;
  position: sticky;
  top: 5.6rem;
  min-height: calc(100vh - 7rem);
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.explorer-sidebar.sidebar > .sidebar-content,
.explorer-sidebar.sidebar .sidebar-content {
  padding-top: 0;
}

.control-section + .control-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--app-border);
}

.control-section-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  font-weight: 700;
  color: var(--app-text);
}

.panel-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.content-stack > * + * {
  margin-top: 1rem;
}

.content-card-block,
.plot-panel,
.content-card,
.about-card,
.about-hero {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  box-shadow: var(--app-shadow-soft);
}

.content-card-block,
.plot-panel {
  padding: 1rem 1rem 0.9rem;
  overflow: hidden;
}

.plot-panel .html-widget,
.content-card-block .html-widget,
.plot-panel .js-plotly-plot,
.content-card-block .js-plotly-plot {
  max-width: 100%;
}

.plot-panel + .plot-panel {
  margin-top: 1rem;
}

.content-card .card-header,
.about-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--app-border);
  padding: 1rem 1.1rem 0.9rem;
}

.content-card .card-body,
.about-card .card-body {
  padding: 1rem 1.1rem 1.1rem;
}

.table-card {
  margin-top: 1rem;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.85rem;
}

.nav-pills {
  gap: 0.5rem;
}

.nav-pills .nav-link {
  border-radius: 999px;
  color: var(--app-muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid transparent;
}

.nav-pills .nav-link:hover,
.nav-pills .nav-link:focus {
  color: var(--app-primary);
  background: rgba(86, 77, 128, 0.08);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  color: var(--app-primary);
  background: rgba(86, 77, 128, 0.12);
  border-color: rgba(86, 77, 128, 0.10);
}

.app-help-label,
.app-help-heading {
  display: inline;
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(86, 77, 128, 0.35);
  text-underline-offset: 0.18em;
}

.app-help-label:hover,
.app-help-label:focus,
.app-help-heading:hover,
.app-help-heading:focus {
  color: var(--app-primary);
  text-decoration-color: rgba(86, 77, 128, 0.7);
}

.app-help-heading {
  font-weight: inherit;
}

.form-label,
label.control-label {
  color: var(--app-text);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.form-control,
.form-select,
.selectize-input,
.selectize-control.multi .selectize-input.has-items {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 0.8rem;
  box-shadow: none;
  color: var(--app-text);
}

.form-control:focus,
.form-select:focus,
.selectize-input.focus {
  border-color: rgba(86, 77, 128, 0.35);
  box-shadow: 0 0 0 0.24rem rgba(86, 77, 128, 0.10);
}

.selectize-dropdown,
.dropdown-menu {
  border: 1px solid var(--app-border);
  border-radius: 0.9rem;
  box-shadow: var(--app-shadow-soft);
}

.status-text,
.selection-caption {
  margin: 0 0 0.8rem;
  font-size: 0.94rem;
  line-height: 1.5;
}

.status-muted {
  color: var(--app-muted);
}

.status-warning {
  color: #8b5e11;
}

.status-danger {
  color: #a43e2c;
}

.selection-caption {
  color: var(--app-muted);
}

.plotly-container,
.html-widget {
  border-radius: 0.85rem;
}

.js-plotly-plot .plotly .main-svg {
  border-radius: 0.85rem;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--app-border);
  border-radius: 0.7rem;
  padding: 0.3rem 0.6rem;
}

table.dataTable thead th,
table.dataTable thead td {
  background: var(--app-surface-alt);
  color: var(--app-text);
  border-bottom: 1px solid var(--app-border) !important;
  font-weight: 700;
}

table.dataTable tbody tr:hover {
  background: rgba(86, 77, 128, 0.04);
}

.about-page {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0.75rem 0 1.5rem;
}

.about-hero {
  padding: 1.5rem 1.6rem;
  margin-bottom: 1rem;
}

.about-hero h2 {
  margin: 0 0 0.55rem;
}

.about-hero p {
  margin: 0;
  color: var(--app-muted);
  max-width: 52rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.about-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--app-muted);
}

.about-card li + li {
  margin-top: 0.65rem;
}

/* ─── About page — new sections ──────────────────────── */

.about-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--app-accent);
}

.about-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.about-disclaimer {
  background: var(--app-mint);
  border: 1px solid var(--app-accent);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  font-size: 0.92rem;
  color: var(--app-text);
  line-height: 1.6;
}

.about-disclaimer p + p {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.about-disclaimer a {
  color: var(--app-primary);
}

.about-disclaimer strong {
  color: var(--app-brand-dark);
}

/* ─── Home / Landing page ─────────────────────────────── */

.home-page {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 0 2.5rem;
}

.home-hero {
  background: linear-gradient(135deg, var(--app-brand-dark) 0%, #564d80 100%);
  border-radius: 1rem;
  padding: 2.5rem 2.25rem;
  margin-bottom: 1.5rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(159, 196, 144, 0.14), transparent 60%);
  pointer-events: none;
}

.home-hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: #ffffff;
  position: relative;
}

.home-hero-description {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.83);
  font-size: 1rem;
  line-height: 1.65;
  position: relative;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 1rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.home-badge:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.home-doi-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.65rem;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
  position: relative;
}

.home-doi-link:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.home-section {
  margin-bottom: 1.75rem;
}

.home-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--app-accent);
}

/* Authors grid */
.home-authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.home-author-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--app-shadow-soft);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.home-author-card:hover {
  box-shadow: var(--app-shadow);
  transform: translateY(-2px);
}

.home-author-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.home-author-name {
  font-weight: 700;
  font-size: 0.97rem;
  color: var(--app-text);
}

.home-author-orcid-icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.home-author-orcid-icon:hover {
  opacity: 1;
}

.home-author-mail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  background: var(--app-primary);
  color: #ffffff;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.home-author-mail:hover {
  background: #44344f;
  color: #ffffff;
  transform: translateY(-1px);
}

.home-author-affils {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.home-author-affils li {
  font-size: 0.82rem;
  color: var(--app-muted);
  line-height: 1.4;
  padding-left: 0.8rem;
  position: relative;
}

.home-author-affils li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--app-accent);
  font-weight: 700;
}

/* Affiliations */
.home-affiliations-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.home-affiliations-list li {
  display: flex;
  gap: 0.65rem;
  font-size: 0.93rem;
  color: var(--app-muted);
  align-items: flex-start;
  line-height: 1.5;
}

.home-affil-number {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--app-primary);
  min-width: 1.2rem;
}

/* Funding */
.home-funding-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.home-funding-list li {
  font-size: 0.92rem;
  color: var(--app-muted);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.5;
}

.home-funding-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--app-accent);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
}

/* Funding logos placeholder */
.home-funding-logos-placeholder {
  background: linear-gradient(135deg, rgba(152, 166, 212, 0.10) 0%, rgba(159, 196, 144, 0.10) 100%);
  border: 2px dashed var(--app-secondary);
  border-radius: 0.85rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.home-funding-placeholder-label {
  color: var(--app-muted);
  font-size: 0.88rem;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Graphical abstract placeholder */
.home-abstract-placeholder {
  background: linear-gradient(135deg, var(--app-mint) 0%, rgba(152, 166, 212, 0.14) 100%);
  border: 2px dashed var(--app-accent);
  border-radius: 1rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-muted);
  font-size: 0.95rem;
  font-style: italic;
}

@media (max-width: 991.98px) {
  .container-fluid {
    padding: 1rem;
  }

  .explorer-sidebar.sidebar {
    position: static;
    top: auto;
  }
}

/* ── Login overlay ────────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-bg);
}

.login-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--app-shadow);
}

.login-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--app-brand-dark);
  margin-bottom: 0.4rem;
  text-align: center;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--app-muted);
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-error {
  color: #a85e18;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  text-align: center;
}
