html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

body {
    font-family: Arial, sans-serif;
    background: #fafafa;
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    margin: 30px auto;
    text-align: center;
}

.site-hero {
  width: min(100%, 940px);
  margin: 0 auto 28px auto;
  padding: 28px 32px;
  border: 1px solid #d7e4db;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fbf8 0%, #ffffff 100%);
  box-shadow: 0 10px 30px rgba(35, 62, 48, 0.08);
  box-sizing: border-box;
}

.site-hero-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.site-hero-link:focus-visible {
  outline: 3px solid #0b63b6;
  outline-offset: 6px;
  border-radius: 14px;
}

.site-hero-layout {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
}

.site-hero-link:hover .site-hero-title,
.site-hero-link:hover .site-hero-subtitle {
  color: #0b4f86;
}

.site-hero-media {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.site-hero-image {
  display: block;
  height: 100%;
  width: auto;
  max-width: min(28vw, 240px);
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(23, 50, 36, 0.16);
}

.site-hero-copy {
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
}

.site-hero-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  color: #173224;
}

.site-hero-subtitle {
  margin: 10px 0 0 0;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 600;
  color: #355644;
}

.site-hero-description {
  margin: 14px 0 0 0;
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.6;
  color: #4a5e52;
}

.page-title {
  margin: 0 0 20px 0;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  color: #163326;
}

.page-link-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 18px auto;
  width: min(100%, 1080px);
}

.page-link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 280px;
  max-width: 340px;
  padding: 14px 18px;
  border: 1px solid #cfe0ef;
  border-radius: 14px;
  background: linear-gradient(135deg, #f4f9ff 0%, #ffffff 100%);
  box-shadow: 0 8px 22px rgba(31, 73, 125, 0.08);
  color: #13324d;
  text-decoration: none;
  text-align: left;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.page-link-card:hover {
  transform: translateY(-2px);
  border-color: #99bbd8;
  box-shadow: 0 12px 28px rgba(31, 73, 125, 0.14);
}

.page-link-card.is-active {
  border-color: #0b63b6;
  background: linear-gradient(135deg, #edf6ff 0%, #ffffff 100%);
  box-shadow: 0 14px 30px rgba(11, 99, 182, 0.16);
}

.page-link-card.is-active .page-link-icon {
  background: #084f92;
  box-shadow: 0 8px 20px rgba(11, 99, 182, 0.24);
}

.page-link-card.is-active .page-link-title {
  color: #0a467e;
}

.page-link-card.is-active .page-link-description {
  color: #365a7c;
}

.page-link-icon {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #0b63b6;
  color: #fff;
}

.page-link-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.page-link-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.page-link-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-link-description {
  font-size: 0.93rem;
  line-height: 1.4;
  color: #4c6175;
}

/* --- Search Form Styling --- */
/* --- Enhanced Responsive Search Form --- */
form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 30px auto;
  padding: 20px 25px;
  max-width: 900px;
  background-color: #fafafa;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Search box — wider and smooth */
form input[type="text"] {
  flex: 1 1 55%;
  min-width: 250px;
  max-width: 600px;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.2s ease;
}

form input[type="text"]:focus {
  outline: none;
  border-color: #007acc;
  box-shadow: 0 0 6px rgba(0, 122, 204, 0.3);
}

/* Slider group next to the search box */
.slider-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #333;
  flex: 0 0 auto;
}

.slider-container input[type="range"] {
  accent-color: #007acc;
  cursor: pointer;
}

/* Submit button */
form button {
  background-color: #007acc;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  flex: 0 0 auto;
}

form button:hover {
  background-color: #005fa3;
}

form button:active {
  transform: scale(0.97);
}

/* --- Responsive tweaks --- */
@media (max-width: 700px) {
  .site-hero {
    padding: 22px 18px;
    margin-bottom: 22px;
  }

  .site-hero-layout {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .site-hero-image {
    height: auto;
    width: min(100%, 260px);
    max-width: 100%;
  }

  .site-hero-copy {
    text-align: center;
  }

  .site-hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .page-link-card {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .page-link-icon {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .page-link-icon svg {
    width: 26px;
    height: 26px;
  }

  form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .slider-container {
    justify-content: center;
  }

  form input[type="text"] {
    width: 100%;
    max-width: none;
  }
}

/* --- Export Button --- */
.export-container {
  text-align: center;
  margin: 15px 0 25px 0;
}

.export-btn {
  background-color: #2b9348;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.export-btn:hover {
  background-color: #207d3a;
}

.export-btn:active {
  transform: scale(0.97);
}

/* --- Image Grid Styling --- */
.image-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.image-card {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  text-align: center;
  width: 220px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.image-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #ddd;
}

.image-card p {
  margin: 10px 0;
  font-size: 14px;
  color: #333;
  padding: 0 5px;
  word-wrap: break-word;
}

.slider-container {
    margin: 10px;
}

/* --- Modal styles (centered) --- */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;   /* center horizontally */
  align-items: center;       /* center vertically */
}

.modal-content {
  max-width: 90%;
  max-height: 85%;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.25s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 38px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close:hover {
  color: #bbb;
}

#caption {
  text-align: center;
  color: #ddd;
  font-size: 16px;
  margin-top: 10px;
}

/* --- Modal layout & arrows --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.modal-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  animation: zoomIn 0.25s ease;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  width: 50px;
  height: 70px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s, transform 0.2s;
  user-select: none;
}

.nav-arrow.left {
  left: -70px;  /* position relative to image edge */
}

.nav-arrow.right {
  right: -70px;
}

.nav-arrow:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 38px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close:hover {
  color: #bbb;
}

#caption {
  text-align: center;
  color: #eee;
  font-size: 16px;
  margin-top: 10px;
  line-height: 1.4;
}

#caption-filename {
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 3px;
}

#caption-score {
  font-size: 15px;
  color: #ccc;
}

/* --- Project Footer --- */
.project-footer {
  margin-top: 40px;
  padding: 20px 10px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.5;
  color: #666;
  border-top: 1px solid #ddd;
  background-color: #fafafa;
}

.project-footer p {
  margin: 0 auto;
  max-width: 900px;
}

@media (prefers-color-scheme: dark) {
  .project-footer {
    background-color: #222;
    border-top: 1px solid #444;
    color: #aaa;
  }
}

/* --- CSV view link --- */
.export-link {
  display: inline-block;
  margin-left: 14px;
  font-size: 14.5px;
  color: #007acc;
  text-decoration: none;
  vertical-align: middle;
}

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

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 10px 0 20px 0;
  font-size: 14px;
  color: #333;
}

.page-btn {
  border: 1px solid #ccc;
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.page-btn:hover:enabled {
  background: #f2f2f2;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rank-status {
  color: #666;
  font-style: italic;
}

.rank-status.done {
  color: #2b9348;
  font-style: normal;
}

.page-input{
  width: 4.5em;
  padding: 2px 6px;
  font: inherit;
}

/* --- Help modal --- */
.help-btn {
  font-weight: 600;
}

.help-modal {
  display: none;
  position: fixed;
  z-index: 1100; /* above image modal (1000) */
  inset: 0;
  background: rgba(0,0,0,0.65);
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.help-modal.open {
  display: flex;
}

.help-modal-box {
  width: min(720px, 95vw);
  max-height: 85vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  padding: 18px 18px 14px 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  position: relative;
  text-align: left;
}

.help-modal-box h2 {
  margin: 0 0 12px 0;
}

.help-modal-box h3 {
  margin: 14px 0 8px 0;
  font-size: 15px;
}

.help-content ul {
  margin: 0 0 10px 18px;
  padding: 0;
}

.help-content li {
  margin: 6px 0;
  line-height: 1.35;
}

.help-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

.help-close:hover {
  opacity: 0.7;
}

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  padding: 2px 6px;
  border: 1px solid #ccc;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #f6f6f6;
}

/* Batch form: make text inputs stack nicely */
#batchForm input[type="text"] {
  flex: 1 1 100%;
  max-width: 900px;
}

.multi-form-layout {
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  max-width: 1080px;
  margin: 30px auto;
}

#multiForm {
  flex: 1 1 0;
  margin: 0;
  max-width: none;
}

#multiPresetPanel {
  flex: 0 1 auto;
  width: fit-content;
  min-width: 120px;
  max-width: 15vw;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  background-color: #fafafa;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

#multiPresetHeader {
  font-size: 14px;
  font-weight: 700;
  color: #2a2a2a;
  text-align: left;
}

#multiPresetList {
  flex: 1 1 auto;
  width: max-content;
  max-width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.multi-preset-btn {
  width: 100%;
  border: 1px solid #cfd6df;
  background: #fff;
  color: #1f2d3d;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}

.multi-preset-btn:hover:enabled {
  background: #f1f6fb;
  border-color: #adc4dd;
}

.multi-preset-btn:active {
  transform: scale(0.98);
}

.multi-preset-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.multi-preset-empty {
  color: #666;
  font-size: 13px;
  text-align: left;
  font-style: italic;
}

/* Multi-concept form: make text inputs stack nicely */
#multiForm input[type="text"] {
  flex: 1 1 100%;
  max-width: 900px;
}

#multiForm #concepts_title {
  flex: 0 1 460px;
  max-width: 460px;
}

@media (max-width: 700px) {
  .multi-form-layout {
    flex-direction: column;
  }

  #multiPresetPanel {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    max-height: 180px;
  }

  #multiForm #concepts_title {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }
}

/* Histogram section */
.dist-section { margin-top: 12px; }
.dist-header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dist-title { font-weight: 600; }
.dist-controls input { width: 70px; }
.hist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.hist-card { border: 1px solid #ddd; border-radius: 8px; padding: 10px; background: #fff; }
.hist-svg { width: 100%; height: 140px; display: block; }
.strip-svg { height: 92px; }
.dot-svg { height: 124px; }
.hist-btn-row { display: flex; gap: 6px; margin: 6px 0; }
.hist-dl-btn {
  font-size: 0.8rem;
  padding: 3px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f7f7f7;
  cursor: pointer;
}

.hist-dl-btn:disabled {
  opacity: 0.58;
  cursor: default;
}

/* Multi page: stack confidence histograms vertically and align width with form */
#multiHistSection {
  width: 100%;
}

#multiHistSection .dist-header {
  justify-content: center;
}

#multiHistSection .dist-title {
  width: 100%;
  text-align: center;
}

#multiHistControls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 10px 0;
  color: #444;
  font-size: 14px;
}

#multiHistControls input[type="range"] {
  width: min(320px, 70vw);
}

#multiHistControls .multi-hist-bins-arrow {
  width: 30px;
  height: 30px;
  border: 1px solid #b9c3cf;
  background: #fff;
  color: #1f2d3d;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

#multiHistControls .multi-hist-bins-arrow:hover:enabled {
  background: #f1f6fb;
}

#multiHistControls .multi-hist-bins-arrow:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#multiHistBinsValue {
  min-width: 2ch;
  text-align: right;
  font-weight: 600;
}

#multiHistGrid {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#multiHistGrid .hist-card {
  width: min(100%, 900px);
  box-sizing: border-box;
}

#multiHistGrid .multi-hist-card {
  position: relative;
}

#multiHistGrid .multi-hist-title {
  padding-right: 120px;
}

#multiHistGrid .multi-hist-dl-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Histogram modal */
.hist-modal {
  display: none;
  position: fixed;
  z-index: 1200;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.hist-modal.open {
  display: flex;
}

.hist-modal-box {
  width: 75vw;
  height: 75vh;
  background: #fff;
  border-radius: 10px;
  position: relative;
  padding: 16px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  overflow: auto;
}

.hist-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

.hist-modal-content .hist-svg {
  height: 260px;
}
.hist-modal-content .strip-svg {
  height: 170px;
}
.hist-modal-content .dot-svg {
  height: 220px;
}
/* Ternary plot toolbar */
#plotContainer .plot-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  margin-bottom: 8px;
}

#plotContainer .plot-title {
  width: 100%;
  text-align: center;
}

#plotContainer .plot-reset-btn {
  font-size: 0.9rem;
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f7f7f7;
  cursor: pointer;
}

#plotContainer .plot-toolbar-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

#plotContainer .plotly-ternary {
  width: 100%;
  height: 520px;
}

#plotContainer .plotly-chart {
  width: 100%;
  height: 220px;
}

/* Multi radar cards */
#radarChartsWrap {
  width: 100%;
  margin: 8px auto 0 auto;
  max-width: 100%;
  text-align: left;
}

#radarChartsWrap .radar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

#radarChartsWrap .radar-aggregate-card {
  border: 1px solid #d7e4db;
  border-radius: 8px;
  background: #f8fcf9;
  padding: 10px 0 12px 0;
  width: min(100%, 900px);
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 12px;
  text-align: center;
}

#radarChartsWrap .radar-aggregate-title {
  font-size: 14px;
  font-weight: 700;
  color: #223429;
  padding: 0 10px;
}

#radarChartsWrap .radar-aggregate-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #466050;
  padding: 0 10px;
}

#radarChartsWrap .radar-aggregate-svg {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  margin: 0 auto 0 auto;
}

#radarChartsWrap .radar-aggregate-chart-wrap {
  position: relative;
  margin-top: 8px;
}

#radarChartsWrap .radar-aggregate-left-controls {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

#radarChartsWrap .radar-aggregate-toggle {
  border: 1px solid #b7c9bc;
  background: rgba(255, 255, 255, 0.95);
  color: #224432;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
}

#radarChartsWrap .radar-aggregate-toggle:hover {
  background: #eef6f0;
}

#radarChartsWrap .radar-aggregate-series-toggle {
  border: 1px solid #b7c9bc;
  background: rgba(255, 255, 255, 0.95);
  color: #224432;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
}

#radarChartsWrap .radar-aggregate-series-toggle:hover {
  background: #eef6f0;
}

#radarChartsWrap .radar-aggregate-download {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: 1px solid #9fb5cc;
  background: rgba(255, 255, 255, 0.95);
  color: #24405f;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
}

#radarChartsWrap .radar-aggregate-download:hover {
  background: #eef3f9;
}

#radarChartsWrap .radar-aggregate-legend {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 720px;
}

#radarChartsWrap .radar-aggregate-chip {
  font-size: 11px;
  color: #2a4838;
  background: #e9f3ed;
  border: 1px solid #c8ddcf;
  border-radius: 999px;
  padding: 3px 8px;
}

#radarChartsWrap .radar-controls select {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  padding: 4px 6px;
  font-size: 14px;
}

#radarChartsWrap .radar-cols-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}

#radarChartsWrap .radar-cols-control input[type="range"] {
  width: 120px;
}

#radarChartsWrap .radar-cols-arrow {
  width: 30px;
  height: 30px;
  border: 1px solid #b9c3cf;
  background: #fff;
  color: #1f2d3d;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

#radarChartsWrap .radar-cols-arrow:hover:enabled {
  background: #f1f6fb;
}

#radarChartsWrap .radar-cols-arrow:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#radarChartsWrap .radar-cols-value {
  min-width: 2ch;
  font-weight: 600;
  text-align: right;
}

#radarChartsWrap .radar-sort {
  margin-bottom: 10px;
}

#radarChartsWrap .radar-sort-label {
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}

#radarChartsWrap .radar-sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#radarChartsWrap .radar-sort-btn {
  border: 1px solid #cfd6df;
  background: #fff;
  color: #1f2d3d;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#radarChartsWrap .radar-sort-btn:hover {
  background: #f1f6fb;
}

#radarChartsWrap .radar-sort-btn.active {
  background: #0b63b6;
  border-color: #0b63b6;
  color: #fff;
}

#radarChartsWrap .radar-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px 0;
}

#radarChartsWrap .radar-page-btn {
  border: 1px solid #ccc;
  background: #fff;
  color: #1f2d3d;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#radarChartsWrap .radar-page-btn:hover:enabled {
  background: #f5f7fa;
}

#radarChartsWrap .radar-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#radarChartsWrap .radar-page-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
  font-weight: 600;
  margin: 0 2px;
}

#radarChartsWrap .radar-page-input {
  width: 4.5em;
  padding: 3px 6px;
  border: 1px solid #c7ced8;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

#radarChartsWrap .radar-grid {
  display: grid;
  gap: 12px;
}

#radarChartsWrap .radar-card {
  width: auto;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}

#radarChartsWrap .radar-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #222;
  word-break: break-word;
}

#radarChartsWrap .radar-card-meta {
  margin-top: 2px;
  margin-bottom: 4px;
  font-size: 11px;
  color: #666;
}

#radarChartsWrap .radar-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Tags exploration page */
.tags-intro-card,
.tags-controls-card,
.tags-chart-card,
.tags-error-card {
  width: min(100%, 1080px);
  margin: 0 auto 18px auto;
  padding: 18px 20px;
  border: 1px solid #d7e1ea;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: 0 8px 24px rgba(27, 45, 62, 0.06);
  box-sizing: border-box;
  text-align: left;
}

.tags-intro-copy {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: #33475b;
}

.tags-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 12px;
  font-size: 0.93rem;
  color: #506171;
}

.tags-intro-details {
  margin-top: 14px;
  color: #33475b;
}

.tags-intro-copy-secondary {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 0.96rem;
}

.tags-intro-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.55;
  color: #33475b;
}

.tags-intro-list li + li {
  margin-top: 6px;
}

.tags-controls-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(280px, 1fr);
  gap: 16px 22px;
  align-items: end;
}

.tags-control-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tags-control-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #22313f;
}

.tags-control-field select {
  min-height: 42px;
  border: 1px solid #bcc9d6;
  border-radius: 8px;
  background: #fff;
  padding: 9px 12px;
  font-size: 15px;
  color: #203040;
}

.tags-control-slider {
  min-width: 0;
}

.tags-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tags-slider-row input[type="range"] {
  flex: 1 1 auto;
  accent-color: #0b63b6;
}

.tags-slider-value {
  min-width: 3ch;
  font-size: 1rem;
  font-weight: 700;
  color: #17324b;
}

.tags-summary {
  margin-top: 14px;
  font-size: 0.95rem;
  color: #465869;
}

.tags-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tags-chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags-chart-actions-stack {
  flex-direction: column;
  align-items: flex-end;
}

.tags-section-title {
  margin: 0;
  font-size: 1.08rem;
  color: #1d3145;
}

.tags-chart-note {
  margin: 6px 0 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #55697d;
}

.tags-svg-wrap {
  width: 100%;
  overflow-x: auto;
}

.tags-svg-wrap-interactive {
  touch-action: none;
  user-select: none;
}

.tags-svg {
  width: 100%;
  height: auto;
  display: block;
}

.tags-empty-state {
  padding: 16px;
  border: 1px dashed #c6d4e0;
  border-radius: 10px;
  background: #fbfcfe;
  color: #536576;
  font-size: 0.95rem;
}

.tags-error-card {
  border-color: #e7c9c9;
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
  color: #7a2222;
}

.tags-tooltip {
  position: fixed;
  z-index: 1300;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid #bfd0df;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 26px rgba(18, 35, 51, 0.18);
  color: #182634;
  pointer-events: none;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.tags-tooltip-title {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #12273b;
  word-break: break-word;
}

.tags-tooltip-key {
  font-weight: 700;
  color: #29455f;
}

/* About page */
.about-page-shell {
  width: min(100%, 1080px);
  margin: 0 auto 18px auto;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.about-media-card,
.about-content-card {
  border: 1px solid #d7e1ea;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: 0 8px 24px rgba(27, 45, 62, 0.06);
  box-sizing: border-box;
}

.about-media-card {
  padding: 16px;
  position: sticky;
  top: 18px;
}

.about-figure {
  margin: 0;
}

.about-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(22, 50, 75, 0.14);
}

.about-figure-caption {
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #35506a;
  text-align: left;
}

.about-content-card {
  padding: 22px 24px;
  text-align: left;
}

.about-paragraph {
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
  color: #34495d;
}

.about-paragraph + .about-paragraph {
  margin-top: 16px;
}

.about-section-title {
  margin: 26px 0 12px 0;
  font-size: 1.08rem;
  color: #1d3145;
}

.about-reference-list {
  margin: 0;
  padding-left: 22px;
  color: #33475b;
}

.about-reference-item {
  line-height: 1.65;
}

.about-reference-item + .about-reference-item {
  margin-top: 10px;
}

.about-citation,
.about-reference-link {
  color: #0b63b6;
  text-decoration: none;
}

.about-citation:hover,
.about-reference-link:hover {
  text-decoration: underline;
}

/* Contact and copyright page */
.contacts-copyrights-shell {
  width: min(100%, 1080px);
  margin: 0 auto 18px auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.contacts-copyrights-card {
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid #d7e1ea;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: 0 8px 24px rgba(27, 45, 62, 0.06);
  box-sizing: border-box;
  text-align: left;
}

.contacts-copyrights-heading {
  margin: 0;
  color: #1d3145;
  font-size: 1.12rem;
  line-height: 1.25;
}

.contacts-copyrights-copy {
  margin: 14px 0 0 0;
  color: #34495d;
  font-size: 1rem;
  line-height: 1.75;
}

.contacts-copyrights-link {
  color: #0b63b6;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contacts-copyrights-link:hover {
  text-decoration: underline;
}

/* Team page */
.team-page-shell {
  width: min(100%, 1080px);
  margin: 0 auto 18px auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.team-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e1ea;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: 0 8px 24px rgba(27, 45, 62, 0.06);
  box-sizing: border-box;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  border-color: #a9c4dc;
  box-shadow: 0 14px 32px rgba(27, 45, 62, 0.13);
}

.team-figure {
  margin: 0;
  padding: 16px 16px 0 16px;
}

.team-image-frame,
.team-image-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 12px;
  background: #e8eef4;
  box-shadow: 0 10px 24px rgba(22, 50, 75, 0.14);
}

.team-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.team-card:hover .team-image {
  transform: scale(1.025);
  filter: contrast(1.05);
}

.team-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #35506a;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.team-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 18px 20px 18px;
}

.team-member-name {
  margin: 0;
  color: #1d3145;
  font-size: 1.12rem;
  line-height: 1.25;
}

.team-member-role {
  margin: 8px 0 0 0;
  color: #35506a;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.45;
}

.team-member-copy {
  margin: 12px 0 0 0;
  color: #34495d;
  font-size: 0.95rem;
  line-height: 1.65;
}

.team-link {
  color: #0b63b6;
  text-decoration: none;
  overflow-wrap: anywhere;
}

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

@media (max-width: 820px) {
  .about-page-shell {
    grid-template-columns: 1fr;
  }

  .about-media-card {
    position: static;
  }

  .tags-controls-grid {
    grid-template-columns: 1fr;
  }

  .tags-chart-header {
    flex-direction: column;
    align-items: stretch;
  }

  .tags-chart-actions-stack {
    align-items: stretch;
  }
}


