:root {
  --bg: #ecf3f7;
  --paper: #fbfdff;
  --ink: #17222d;
  --muted: #5e6a73;
  --line: #d3dde6;
  --accent: #0c5c75;
  --accent-soft: #dceff2;
  --shadow: 0 18px 40px rgba(23, 34, 45, 0.08);
  --radius: 18px;
  --surface: #f4f8fb;
  --surface-strong: #eef4f8;
  --na: #999999;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(12, 92, 117, 0.12), transparent 26%),
    radial-gradient(circle at top right, rgba(50, 115, 143, 0.08), transparent 24%),
    linear-gradient(180deg, #f9fcff 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.page-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  background: linear-gradient(135deg, rgba(12, 92, 117, 0.96), rgba(25, 92, 71, 0.92));
  color: #f8fffd;
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  opacity: 0.84;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

.hero-text,
.hero-meta {
  margin: 0;
  max-width: 780px;
}

.hero-meta {
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.8;
}

.overview-grid {
  display: grid;
  gap: 20px;
}

.selector-card,
.summary-card,
.card {
  background: var(--paper);
  border: 1px solid rgba(23, 34, 45, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.selector-card {
  margin-bottom: 20px;
  padding: 18px 20px;
}

.selector-row {
  display: grid;
  grid-template-columns: minmax(360px, 1.6fr) minmax(180px, 0.8fr);
  gap: 16px;
  align-items: end;
}

.card-header h2 {
  margin: 0;
  font-size: 20px;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.field--compact {
  margin-top: 0;
}

.field span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

select,
button,
input {
  font: inherit;
}

select,
#exonSearch,
.table-filter input,
.toolbar-group--download button,
.table-actions button,
.toggle-button {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 10px 12px;
}

select,
.toolbar-group--download button,
.table-actions button {
  width: 100%;
}

.search-shell {
  position: relative;
}

#exonSearch {
  width: 100%;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 253, 255, 0.98);
  box-shadow: 0 20px 40px rgba(23, 34, 45, 0.14);
  z-index: 20;
}

.search-result,
.search-empty {
  padding: 12px 14px;
}

.search-result {
  border-bottom: 1px solid rgba(211, 221, 230, 0.65);
  cursor: pointer;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result:hover,
.search-result.is-active {
  background: var(--accent-soft);
}

.search-result-id {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.search-result-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.search-empty {
  font-size: 13px;
  color: var(--muted);
}

.selector-help {
  margin-top: 12px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toggle-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.toolbar-group--download button,
.table-actions button {
  cursor: pointer;
}

.toolbar-group--download button:disabled,
.table-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.help-text,
.subtitle,
.single-value {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.summary-card {
  display: grid;
  gap: 18px;
  padding: 18px;
}

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

.value-box {
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface) 100%);
  border: 1px solid rgba(23, 34, 45, 0.08);
}

.value-box .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.value-box .value {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
}

.card {
  padding: 0 18px 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0 12px;
}

.card-header--stackable {
  align-items: end;
}

.stack {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.heatmap-toolbar {
  display: grid;
  grid-template-columns: minmax(250px, 320px) 1fr auto;
  gap: 14px;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.heatmap-main {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.plot-frame {
  width: 100%;
}

.heatmap-plot {
  min-height: 460px;
}

.medium-plot {
  min-height: 420px;
}

.logo-card {
  padding: 0 18px 6px;
}

.logo-card .card-header {
  padding: 10px 0 6px;
}

.logo-frame {
  overflow-x: auto;
  overflow-y: visible;
  height: auto;
}

.logo-svg {
  display: block;
  width: 100%;
  min-width: 980px;
  height: 380px;
}

.logo-axis-text {
  fill: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.logo-axis-label {
  fill: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.logo-boundary {
  stroke: #111827;
  stroke-width: 1;
  stroke-dasharray: 6 4;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap--scroll {
  max-height: 520px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 700;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
}

.plot-message {
  margin-top: 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 12px 14px;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.runtime-error {
  margin-bottom: 20px;
  border-radius: 16px;
  border: 1px solid rgba(177, 18, 38, 0.22);
  background: #fff3f2;
  color: #8f1121;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
  white-space: pre-wrap;
}

.table-card .card-header {
  align-items: end;
}

.table-actions {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 12px;
  align-items: end;
}

.table-filter {
  display: grid;
  gap: 8px;
  min-width: min(320px, 100%);
}

.table-filter span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.table-filter input {
  min-width: 0;
}

.toolbar-group {
  display: grid;
  gap: 8px;
}

.toolbar-group--logo {
  min-width: 280px;
}

.toolbar-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.button-row--toolbar {
  grid-template-columns: 1fr 1fr;
}

.button-row--compact .toggle-button {
  white-space: nowrap;
}

.toolbar-group--checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding-bottom: 10px;
  font-size: 14px;
}

.heatmap-help {
  margin-top: 12px;
}

.table-wrap table tbody tr:nth-child(2n) {
  background: rgba(12, 92, 117, 0.04);
}

.sv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  font-size: 14px;
}

.sv-toolbar .toolbar-label {
  margin-right: 2px;
}

@media (max-width: 980px) {
  .selector-row,
  .heatmap-toolbar,
  .table-actions,
  .card-header--stackable {
    grid-template-columns: 1fr;
  }

  .card-header,
  .card-header--stackable {
    flex-direction: column;
    align-items: stretch;
  }

  .value-grid {
    grid-template-columns: 1fr;
  }

  .table-card .card-header {
    align-items: stretch;
  }

  .toolbar-group--checks {
    display: grid;
    gap: 10px;
    padding-bottom: 0;
  }

  .logo-svg {
    min-width: 760px;
  }
}
