:root {
  color-scheme: light;
  --page: #eef3f9;
  --panel: rgba(255, 255, 255, 0.9);
  --surface: #ffffff;
  --surface-muted: #f6f8fb;
  --border: #d6dfeb;
  --border-strong: #bdcadb;
  --text: #14213d;
  --muted: #64748b;
  --primary: #166534;
  --primary-hover: #18713a;
  --primary-soft: #edf7f0;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(8, 15, 30, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-width: 0;
  overflow-x: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.58;
}

.genes-app {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
  background: url('../background.png') center center / cover fixed no-repeat;
}

.portal-header {
  width: 100%;
  max-width: 1180px;
  min-width: 0;
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.portal-hero {
  min-width: 0;
  position: relative;
  text-align: center;
}

.portal-hero-content {
  min-width: 0;
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 4px 16px 2px;
  color: #12203b;
}

.portal-hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
}

.portal-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(150%);
  scrollbar-width: thin;
}

.portal-nav-item {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(22, 101, 52, 0.18);
  border-radius: 8px;
  color: #17324d;
  background: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.portal-nav-item:hover {
  border-color: rgba(22, 101, 52, 0.34);
  background: rgba(255, 255, 255, 0.84);
}

.portal-nav-item.active {
  border-color: rgba(22, 101, 52, 0.58);
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(22, 101, 52, 0.28);
}

.portal-nav-item:disabled {
  color: rgba(23, 50, 77, 0.72);
  background: rgba(255, 255, 255, 0.38);
}

.genes-main {
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  justify-self: center;
  align-self: start;
  display: grid;
  gap: 14px;
}

.gene-search-panel {
  padding: 24px;
  border: 1px solid rgba(214, 223, 239, 0.88);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(8, 15, 30, 0.1);
  backdrop-filter: blur(16px) saturate(140%);
}

.section-label {
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.gene-search-form {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.gene-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

#gene-search-input {
  width: 100%;
  height: 52px;
  min-width: 0;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  font-size: 16px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

#gene-search-input::placeholder {
  color: #7b8aa0;
}

#gene-search-input:focus {
  border-color: rgba(22, 101, 52, 0.62);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.13);
}

.primary {
  min-height: 52px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
  transition: background 140ms ease, border-color 140ms ease;
}

.primary:hover:not(:disabled) {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.gene-examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.gene-examples-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.gene-examples button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #28435d;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.gene-examples button:hover {
  border-color: rgba(22, 101, 52, 0.42);
  color: var(--primary);
  background: var(--primary-soft);
}

.gene-search-status {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #334155;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(8, 15, 30, 0.07);
  font-size: 13px;
  font-weight: 700;
}

.gene-search-status.is-error {
  border-color: rgba(180, 35, 24, 0.3);
  color: var(--danger);
  background: #fff7f6;
}

.gene-results-section {
  width: 100%;
  min-width: 0;
  padding: 20px;
  justify-self: center;
  border: 1px solid rgba(214, 223, 239, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 36px rgba(8, 15, 30, 0.09);
  backdrop-filter: blur(16px) saturate(140%);
}

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

.gene-results-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.gene-results-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.gene-results {
  border-top: 1px solid #e5e7eb;
}

.gene-result {
  min-width: 0;
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

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

.gene-result-title {
  color: #256b39;
  font-size: 15px;
  line-height: inherit;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.gene-result-title:hover {
  color: #0b4626;
}

.gene-result-fields {
  display: grid;
  gap: 5px;
  margin: 0;
}

.gene-result-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.gene-result-field dt {
  margin: 0;
  color: #2c7a3e;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.gene-result-field dd {
  margin: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.gene-more-count {
  display: inline-block;
  margin-left: 7px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.gene-result-field dd.gene-description {
  color: #475569;
}

.gene-empty-result {
  padding: 34px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
}

.gene-pagination {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.gene-pagination button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #28435d;
  background: var(--surface);
  font-weight: 800;
}

.gene-pagination button:hover:not(:disabled) {
  border-color: rgba(22, 101, 52, 0.4);
  color: var(--primary);
  background: var(--primary-soft);
}

.gene-pagination span {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.gene-result.is-loading {
  min-height: 146px;
  overflow: hidden;
  position: relative;
}

.gene-result.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(226, 232, 240, 0.6) 48%, transparent 76%);
  transform: translateX(-100%);
  animation: gene-loading 1.2s infinite;
}

.gene-skeleton-line {
  height: 12px;
  margin-top: 12px;
  border-radius: 4px;
  background: #e8edf3;
}

.gene-skeleton-line:first-child {
  width: 38%;
  height: 18px;
  margin-top: 0;
}

.gene-skeleton-line:nth-child(2) {
  width: 68%;
}

.gene-skeleton-line:nth-child(3) {
  width: 92%;
}

.gene-detail-section {
  --gene-detail-content-size: 15px;
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  justify-self: center;
}

.gene-detail-back {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 0 0 10px;
  padding: 0 10px;
  border: 1px solid rgba(214, 223, 235, 0.92);
  border-radius: 6px;
  color: #28435d;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(8, 15, 30, 0.06);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(12px) saturate(130%);
}

.gene-detail-back::before {
  content: '\2190';
  margin-right: 7px;
  font-size: 16px;
  line-height: 1;
}

.gene-detail-back:hover {
  border-color: rgba(22, 101, 52, 0.38);
  color: var(--primary);
  background: var(--primary-soft);
}

#gene-detail-content,
.gene-detail-loading {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(214, 223, 235, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(8, 15, 30, 0.11);
  backdrop-filter: blur(16px) saturate(135%);
}

#gene-detail-content {
  background: var(--surface);
}

.gene-detail-loading {
  display: grid;
  gap: 16px;
  min-height: 240px;
  padding: 30px;
}

.gene-detail-loading-line {
  height: 18px;
  border-radius: 4px;
  background: #e7edf4;
}

.gene-detail-loading-line:first-child {
  width: min(58%, 520px);
  height: 36px;
}

.gene-detail-loading-line:nth-child(2) {
  width: min(88%, 840px);
}

.gene-detail-loading-line:nth-child(3) {
  width: 100%;
  height: 128px;
}

.gene-detail-header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px 22px;
}

.gene-detail-title-group {
  min-width: 0;
}

.gene-detail-header h2 {
  max-width: 100%;
  margin: 0;
  color: #1F5631;
  font-size: 28px;
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.gene-detail-symbols {
  min-width: 0;
}

.gene-genome-browser-link {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(22, 101, 52, 0.34);
  border-radius: 7px;
  color: #0f5b31;
  background: var(--primary-soft);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.gene-genome-browser-link:hover {
  border-color: rgba(22, 101, 52, 0.58);
  color: #ffffff;
  background: var(--primary);
}

.gene-sequence-metadata dt {
  margin: 0 0 5px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.25;
}

.gene-detail-block {
  min-width: 0;
  padding: 25px 28px 27px;
  border-top: 1px solid #e4eaf1;
  font-size: var(--gene-detail-content-size);
}

.gene-block-header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.gene-block-header h3 {
  margin: 0;
  color: #1F5631;
  font-size: 19px;
  font-weight: 820;
  line-height: 1.25;
  letter-spacing: 0;
}

.gene-block-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.gene-reliability-grade {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #334155;
  background: #f8fafc;
  font-weight: 850;
  white-space: nowrap;
}

.gene-reliability-grade[data-grade='F1'] {
  border-color: #9dcfaf;
  color: #14532d;
  background: #ecf8f0;
}

.gene-reliability-grade[data-grade='F2'] {
  border-color: #9bcac5;
  color: #165d59;
  background: #eef9f7;
}

.gene-reliability-grade[data-grade='F3'] {
  border-color: #e7c873;
  color: #715510;
  background: #fff9e8;
}

.gene-reliability-grade[data-grade='F4'] {
  border-color: #e8afa8;
  color: #8d2f26;
  background: #fff3f1;
}

.gene-predicted-function {
  max-width: 96ch;
  margin: 0;
  color: #334155;
  font-weight: 520;
  line-height: 1.72;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.gene-detail-symbols,
.gene-reported-id-list {
  max-width: 100%;
  color: #29445d;
  font-weight: 650;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.gene-detail-symbols.is-empty,
.gene-reported-id-list.is-empty {
  color: var(--muted);
}

.gene-transcript-list {
  min-width: 0;
}

.gene-transcripts {
  min-width: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid #dfe6ee;
  list-style: none;
}

.gene-transcripts li {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #e6ebf1;
}

.gene-transcripts li:last-child {
  border-bottom: 0;
}

.gene-transcript-id {
  min-width: 0;
  color: #263f58;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.gene-representative-badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid #a9d0b7;
  border-radius: 5px;
  color: #14532d;
  background: #eef8f1;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.gene-annotation-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 340px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

#gene-annotation-filter {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

#gene-annotation-filter:focus {
  border-color: rgba(22, 101, 52, 0.58);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.11);
}

#gene-annotation-count {
  color: var(--muted);
  font-weight: 750;
  text-align: right;
}

.gene-annotation-list {
  min-width: 0;
  margin-top: 15px;
}

.gene-annotation-terms {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid #e2e8f0;
  list-style: none;
}

.gene-annotation-terms li {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e8edf3;
}

.gene-annotation-id {
  width: fit-content;
  max-width: 100%;
  color: #0f5b31;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

a.gene-annotation-id {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.gene-annotation-description {
  color: #53677d;
  font-weight: 620;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.gene-annotation-description::before {
  content: '\2014';
  margin-right: 10px;
  color: #94a3b8;
}

.gene-inline-pagination {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.gene-inline-pagination span {
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.gene-secondary-button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  color: #29445d;
  background: #ffffff;
  font-weight: 800;
  line-height: 1.25;
}

.gene-secondary-button:hover:not(:disabled) {
  border-color: rgba(22, 101, 52, 0.4);
  color: var(--primary);
  background: var(--primary-soft);
}

.gene-detail-empty {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dde5ee;
  border-radius: 6px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 650;
  line-height: 1.5;
  text-align: center;
}

.gene-expression-chart {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.gene-expression-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #607286;
  font-weight: 700;
}

.gene-expression-legend > span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gene-expression-legend-mean {
  width: 14px;
  height: 12px;
  border-radius: 2px 2px 0 0;
  background: #2f7d4a;
}

.gene-expression-legend-sd {
  width: 16px;
  height: 12px;
  position: relative;
  border-top: 2px solid #334155;
  border-bottom: 2px solid #334155;
}

.gene-expression-legend-sd::after {
  content: '';
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 7px;
  border-left: 2px solid #334155;
}

.gene-expression-scroll {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #dce4ed;
  border-radius: 7px;
  background: #ffffff;
  scrollbar-width: thin;
}

.gene-expression-plot {
  min-height: 390px;
  display: grid;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  padding: 72px 14px 12px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 62px,
    #edf1f5 63px,
    transparent 64px
  );
}

.gene-expression-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 280px minmax(40px, auto);
  align-items: stretch;
  gap: 4px;
  position: relative;
  outline: none;
}

.gene-expression-column:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.16);
}

.gene-expression-tooltip {
  max-width: 250px;
  position: absolute;
  top: -61px;
  left: 50%;
  z-index: 8;
  padding: 7px 9px;
  border-radius: 5px;
  color: #ffffff;
  background: #172c45;
  box-shadow: 0 8px 20px rgba(8, 15, 30, 0.18);
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.gene-expression-column:hover .gene-expression-tooltip,
.gene-expression-column:focus-visible .gene-expression-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.gene-expression-bar-area {
  width: 100%;
  height: 280px;
  position: relative;
  border-bottom: 1px solid #9aa8b7;
}

.gene-expression-bar {
  width: min(38px, 70%);
  min-height: 0;
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 1;
  border-radius: 3px 3px 0 0;
  background: #2f7d4a;
  transform: translateX(-50%);
}

.gene-expression-bar.has-value {
  min-height: 2px;
}

.gene-expression-error-bar {
  width: 18px;
  position: absolute;
  left: 50%;
  z-index: 3;
  border-top: 2px solid #334155;
  border-bottom: 2px solid #334155;
  transform: translateX(-50%);
}

.gene-expression-error-bar::after {
  content: '';
  height: 100%;
  position: absolute;
  top: -2px;
  left: 7px;
  border-left: 2px solid #334155;
}

.gene-expression-value {
  position: absolute;
  left: 50%;
  z-index: 4;
  padding: 1px 3px;
  color: #173f2a;
  background: rgba(255, 255, 255, 0.88);
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
  transform: translateX(-50%);
}

.gene-expression-label {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  align-self: start;
  justify-content: center;
  gap: 4px;
  color: #40566d;
  font-weight: 720;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

.gene-paper-list {
  min-width: 0;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0 0 25px;
}

.gene-paper-list.is-empty {
  padding: 0;
  list-style: none;
}

.gene-paper-list li:not(.gene-detail-empty) {
  min-width: 0;
  padding: 11px 4px 12px 7px;
  border-bottom: 1px solid #e6ebf1;
  color: #64748b;
}

.gene-paper-list li:first-child:not(.gene-detail-empty) {
  border-top: 1px solid #e6ebf1;
}

.gene-paper-title {
  color: #334155;
  font-weight: 680;
  line-height: 1.52;
  overflow-wrap: anywhere;
}

.gene-paper-doi {
  display: inline-block;
  margin-top: 5px;
  color: #0f5b31;
  font-weight: 750;
  line-height: 1.4;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

#gene-paper-more,
#gene-similarity-more {
  margin-top: 14px;
}

.gene-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #dce4ed;
  border-radius: 6px;
}

.gene-similarity-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.gene-similarity-table th,
.gene-similarity-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e4e9ef;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.gene-similarity-table th {
  color: #566b80;
  background: #f5f7fa;
  font-weight: 850;
  line-height: 1.3;
}

.gene-similarity-table td {
  color: #42566c;
  background: #ffffff;
  font-weight: 620;
  line-height: 1.45;
}

.gene-similarity-table th:nth-child(1) {
  width: 24%;
}

.gene-similarity-table th:nth-child(2) {
  width: 12%;
}

.gene-similarity-table th:nth-child(3) {
  width: 12%;
}

.gene-similarity-table th:nth-child(4) {
  width: 52%;
}

.gene-similarity-table tbody tr:last-child td {
  border-bottom: 0;
}

.gene-similarity-table a {
  color: #0f5b31;
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.gene-sequence-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
}

.gene-sequence-control {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.gene-sequence-control label {
  color: #53677d;
  font-weight: 800;
}

.gene-sequence-control select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 32px 0 10px;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  color: #263f58;
  background: #ffffff;
  font: inherit;
  font-weight: 700;
  outline: none;
}

.gene-sequence-control select:focus {
  border-color: rgba(22, 101, 52, 0.58);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.11);
}

.gene-sequence-panel {
  min-width: 0;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #d8e1eb;
  border-radius: 7px;
  background: #f7f9fb;
}

.gene-sequence-state {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px;
  color: var(--muted);
  font-weight: 680;
  line-height: 1.5;
  text-align: center;
}

.gene-sequence-state.is-error {
  color: var(--danger);
  background: #fff7f6;
}

.gene-sequence-toolbar {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid #d8e1eb;
  background: #ffffff;
}

.gene-sequence-metadata {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
}

.gene-sequence-metadata > div {
  min-width: 0;
}

.gene-sequence-metadata dd {
  margin: 0;
  color: #344b63;
  font-weight: 720;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.gene-sequence-copy-button {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.gene-sequence-copy-button:hover {
  background: rgba(20, 33, 61, 0.06);
}

.gene-sequence-copy-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.16);
}

.gene-sequence-copy-icon {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

#gene-sequence-value {
  width: 100%;
  max-height: 360px;
  margin: 0;
  padding: 17px;
  overflow: auto;
  color: #213a52;
  background: #f7f9fb;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 520;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre;
}

.gene-copy-fallback {
  position: fixed;
  top: -1000px;
  left: -1000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes gene-loading {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 860px) {
  .genes-app {
    padding: 16px;
  }

  .portal-hero h1 {
    font-size: 24px;
  }

  .gene-search-panel,
  .gene-results-section {
    padding: 18px;
  }

  .gene-detail-header,
  .gene-detail-block {
    padding-right: 22px;
    padding-left: 22px;
  }

}

@media (max-width: 580px) {
  .genes-app {
    gap: 14px;
    padding: 12px;
    background-attachment: scroll;
  }

  .portal-hero-content {
    padding-inline: 4px;
  }

  .portal-hero h1 {
    font-size: 21px;
    line-height: 1.16;
  }

  .portal-nav {
    min-height: 54px;
    border-radius: 8px;
  }

  .portal-nav-item {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .gene-search-panel,
  .gene-results-section {
    padding: 15px;
  }

  .gene-search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .primary {
    min-height: 44px;
  }

  .gene-examples {
    align-items: flex-start;
  }

  .gene-examples-label {
    flex-basis: 100%;
  }

  .gene-result {
    padding: 14px 0;
  }

  .gene-result-field {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 7px;
  }

  .gene-pagination {
    grid-template-columns: 86px minmax(0, 1fr) 86px;
    gap: 8px;
  }

  .gene-detail-back {
    margin-bottom: 8px;
  }

  .gene-detail-loading {
    min-height: 210px;
    padding: 20px;
  }

  .gene-detail-header {
    flex-direction: column;
    gap: 16px;
    padding: 21px 17px 18px;
  }

  .gene-detail-header h2 {
    font-size: 21px;
    line-height: 1.22;
  }

  .gene-genome-browser-link {
    align-self: stretch;
  }

  .gene-detail-block {
    padding: 21px 17px 23px;
  }

  .gene-block-header {
    gap: 12px;
    margin-bottom: 15px;
  }

  .gene-predicted-function {
    line-height: 1.68;
  }

  .gene-annotation-toolbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  #gene-annotation-count {
    text-align: left;
  }

  .gene-inline-pagination {
    grid-template-columns: 82px minmax(0, 1fr) 82px;
    gap: 7px;
  }

  .gene-sequence-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .gene-sequence-toolbar {
    flex-direction: column;
    gap: 12px;
  }

  #gene-sequence-copy {
    align-self: flex-end;
  }

  #gene-sequence-value {
    max-height: 320px;
    padding: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
