body {
  margin: 0;
  background: #f3f6f8;
  color: #24313f;
  font-family: Arial, Helvetica, sans-serif;
}

.page-wrap {
  max-width: 1280px;
  margin: 26px auto 36px auto;
  padding: 0 18px;
}

.tool-card {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 3px 16px rgba(0,0,0,0.10);
}

h1 {
  text-align: center;
  margin: 0;
  color: #1f4e3d;
  font-size: 30px;
}

.subtitle {
  text-align: center;
  color: #667;
  margin: 12px 0 26px 0;
}

.search-box {
  display: flex;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto 18px auto;
}

.search-box input {
  flex: 1;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #bcc7d1;
  border-radius: 6px;
}

.search-box button,
.tree-toolbar button {
  background: #26734d;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px 22px;
  cursor: pointer;
  font-size: 15px;
}

.search-box button:hover,
.tree-toolbar button:hover {
  background: #1f5e3f;
}

#message {
  max-width: 860px;
  margin: 12px auto;
  color: #b00020;
  font-weight: bold;
}

.summary-card {
  margin-top: 24px;
  padding: 18px 20px;
  background: #eef7f1;
  border-left: 5px solid #26734d;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.label {
  color: #687685;
  font-size: 13px;
  margin-bottom: 6px;
}

.og-title {
  font-size: 18px;
  font-weight: bold;
  color: #18392b;
}

.download-links .download-link-item {
  margin-bottom: 3px;
}

.download-links .download-link-item a {
  display: block;
  color: #0b65c2;
  text-decoration: none;
  font-weight: bold;
}

.download-links .download-link-item a:hover {
  text-decoration: underline;
}

h2 {
  margin-top: 30px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d8e0e6;
  color: #234;
  font-size: 21px;
}

.gene-grid {
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: #fafafa;
  padding: 12px;
}

.sub-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sub-btn {
  padding: 8px 14px;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  border: 1px solid #ccc;
  font-size: 14px;
}

.sub-btn:hover {
  background: #f2f7f4;
}

.sub-A {
  border-left: 5px solid #d73027;
}

.sub-B {
  border-left: 5px solid #4575b4;
}

.sub-D {
  border-left: 5px solid #1a9850;
}

.sub-Other {
  border-left: 5px solid #777;
}

#memberSelectBox {
  margin: 10px 0;
}

#memberSelectBox select {
  padding: 7px 10px;
  min-width: 260px;
  border: 1px solid #bcc7d1;
  border-radius: 5px;
}

.gene-detail-list {
  max-height: 240px;
  overflow: auto;
  font-family: Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px;
}

.tree-toolbar {
  margin-bottom: 8px;
}

.tree-toolbar button {
  padding: 7px 13px;
  font-size: 13px;
  margin-right: 6px;
}

#treeBox {
  height: 760px;
  overflow: auto;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: #fff;
}

#treeSvg {
  transform-origin: top left;
}

#alignmentBox {
  overflow: auto;
  max-height: 650px;
  background: #111;
  color: #eee;
  padding: 14px;
  border-radius: 8px;
  font-family: Consolas, monospace;
  font-size: 13px;
  white-space: pre;
  line-height: 1.45;
}

.aa-header {
  color: #66d9ef;
  font-weight: bold;
}

.aa-gap {
  color: #777;
}

.aa-stop {
  color: #ff7070;
}

.local-header {
  background: #184f3a;
  color: #fff;
  border-bottom: 4px solid #2e8b57;
}
.local-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { font-size: 22px; font-weight: bold; letter-spacing: 0.3px; }
.brand-subtitle { font-size: 14px; opacity: 0.9; }
.local-footer {
  max-width: 1280px;
  margin: 0 auto 26px auto;
  padding: 16px 18px;
  text-align: center;
  color: #667;
  font-size: 13px;
}

#siteHeader, #siteFooter { width: 100%; }
#siteHeader * { box-sizing: content-box; }
.tree-legend {
  margin: 8px 0 10px 0;
  padding: 8px 10px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  width: fit-content;
}
.legend-line { display: inline-block; width: 28px; height: 0; border-top: 2px solid #777; margin-right: 6px; vertical-align: middle; }
.legend-A { border-color: #d73027; }
.legend-B { border-color: #4575b4; }
.legend-D { border-color: #1a9850; }
.legend-Other { border-color: #777777; }

/* ---------- Cluster badge ---------- */
.cluster-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 13px;
  margin-left: 10px;
  vertical-align: middle;
}
.cluster-badge-1 { background: #e3f2fd; color: #1565c0; }
.cluster-badge-2 { background: #fce4ec; color: #c62828; }
.cluster-badge-3 { background: #e8f5e9; color: #2e7d32; }
.cluster-badge-4 { background: #fff3e0; color: #e65100; }
.cluster-badge-5 { background: #f3e5f5; color: #7b1fa2; }
.cluster-badge-6 { background: #e0f7fa; color: #00695c; }
.cluster-badge-7 { background: #fbe9e7; color: #4e342e; }

/* ----- type tree tabs ----- */
.type-tree-tab {
  background: #e9ecef;
  border: 1px solid #bcc7d1;
  padding: 7px 18px;
  font-size: 14px;
  cursor: pointer;
  color: #495057;
  margin-right: 4px;
  border-radius: 6px 6px 0 0;
}
.type-tree-tab.active {
  background: #26734d;
  color: #fff;
  border-color: #26734d;
}
.type-tree-tab:hover:not(.active) {
  background: #d6dadd;
}
