:root {
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 18px;
  color: #183b3a;
  background: #f4faf8;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a:where(:any-link) {
  color: #176f67;
  text-underline-offset: 0.16em;
}

header {
  min-height: 84px;
  padding: 0 max(24px, calc((100% - 1040px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cfe1dc;
  background: #fff;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand strong {
  font-size: 25px;
  line-height: 1.1;
}

.language-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid #cfe1dc; border-radius: 10px; flex-shrink: 0; }
.language-switch button { padding: 7px 12px; border-radius: 7px; background: transparent; color: #637c77; font: inherit; font-size: 16px; }
.language-switch button[aria-pressed="true"] { background: #176f67; color: #fff; }
.language-switch button:focus-visible, #choose-file:focus-visible { outline: 2px solid #176f67; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px !important; height: 1px; min-height: 0 !important; padding: 0 !important; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#file-input-panel { position: relative; }
.file-picker { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px; border: 1px solid #bfd4cf; border-radius: 10px; }
.file-picker button { padding: 6px 10px; }
#file-name { font-size: 16px; overflow-wrap: anywhere; min-width: 0; }
.title-en { display: none; }
html[lang="en"] h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.2; }
html[lang="en"] .title-zh { display: none; }
html[lang="en"] .title-en { display: inline; }
@media (max-width: 600px) {
  header { height: auto; min-height: 84px; padding: 16px 24px; gap: 14px; flex-wrap: wrap; }
  .language-switch { margin-left: auto; }
  .form-heading { flex-wrap: wrap; }
}

.brand strong,
.brand small {
  display: block;
}

.brand > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.brand small {
  color: #66807a;
  font-size: 14px;
  line-height: 1.35;
}

.logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #176f67;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

main {
  max-width: 1040px;
  margin: auto;
  padding: 32px 24px 64px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 184px;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.intro-copy {
  min-width: 0;
}

.intro-copy > p:last-child {
  white-space: nowrap;
  font-size: 16px;
  margin: 24px 0 0;
}

.hero-mosquito-frame {
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  justify-self: end;
  transform: translateX(-140px);
  border-radius: 50%;
  background: #e3f1ec;
  border: 3px solid #176f67;
  overflow: hidden;
}

html[lang="en"] .hero-mosquito-frame {
  transform: translateX(-40px);
}

.hero-mosquito {
  display: block;
  width: 158px;
  height: auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .13em;
  color: #18756a;
  font-weight: 750;
  font-size: 14px;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.12;
  margin: 0 0 14px;
}

h2 {
  font-size: 24px;
  margin: 0 0 4px;
}

.panel-head p,
#status-message {
  color: #637c77;
}

.panel {
  width: calc(100% + 120px);
  margin-left: -60px;
  background: #fff;
  border: 1px solid #cfe1dc;
  border-radius: 18px;
  box-shadow: 0 24px 55px -42px #0c4f48;
  overflow: hidden;
}

#job-form {
  margin-top: 40px;
}

.panel-head {
  padding: 26px 30px;
  border-bottom: 1px solid #dbe8e4;
  background: #f8fcfb;
}

.panel-head p {
  margin: 0;
}

.form-grid {
  padding: 30px 30px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 24px;
}

.form-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-heading h2 { margin: 0; }
button.secondary-button { padding: 10px 17px; color: #176f67; background: #e9f5f1; border: 1px solid #bfd4cf; font: inherit; font-size: 18px; font-weight: 800; white-space: nowrap; }
button.secondary-button:hover:not(:disabled) { background: #dceee7; }
.sequence-source { min-width: 0; margin: 0; padding: 0; border: 0; }
.sequence-source legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.sequence-modes { position: relative; top: 12px; display: flex; flex-wrap: wrap; gap: 14px 32px; margin-bottom: 22px; }
.sequence-modes label { display: inline-flex; flex-direction: row; align-items: center; gap: 9px; font-size: 20px; font-weight: 500; cursor: pointer; }
.sequence-modes input { accent-color: #176f67; margin: 0; }
.sequence-source small { display: block; color: #708781; margin-top: 8px; }
.sequence-input-panel small { font-size: 17px; line-height: 1.45; }
.sequence-input-panel { grid-column: 1 / -1; min-width: 0; }
textarea { display: block; width: 100%; min-height: 230px; resize: vertical; border: 1px solid #bfd4cf; border-radius: 10px; padding: 14px; color: #183b3a; background: #fff; font: 17px/1.7 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
textarea:focus { outline: 2px solid #a7d8cb; outline-offset: 1px; }
.input-message { margin: 0; padding: 0 26px 18px; color: #637c77; font-size: 17px; line-height: 1.45; }
.input-message.is-error { color: #9b4630; }

label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

label small {
  font-weight: 400;
  color: #708781;
}

select,
input[type="file"],
input[type="text"] {
  width: 100%;
  min-height: 52px;
  border: 1px solid #bfd4cf;
  border-radius: 10px;
  background: #fff;
  padding: 11px 13px;
  color: #183b3a;
  font: inherit;
  font-size: 17px;
}

input::placeholder,
textarea::placeholder {
  color: #829793;
  opacity: 1;
  font-size: 16px;
}

input[type="file"] {
  padding: 8px;
}

.actions {
  border-top: 1px solid #dbe8e4;
  padding: 24px 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

button,
.download {
  border: 0;
  border-radius: 10px;
  background: #176f67;
  color: #fff;
  padding: 13px 21px;
  font-weight: 750;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
  text-decoration: none;
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

.status {
  margin-top: 24px;
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.status p {
  margin: 6px 0;
}

.status code {
  font-size: 17px;
  color: #708781;
}

.status-content { flex: 1; min-width: 0; }
#status-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.progress-panel { margin-top: 20px; }
.progress-heading { display: flex; justify-content: space-between; gap: 16px; font-size: 18px; }
.progress-heading strong { color: #176f67; font-variant-numeric: tabular-nums; }
.progress-track { height: 10px; margin-top: 9px; border-radius: 20px; background: #e8f1ee; overflow: hidden; }
.progress-fill { width: 0; height: 100%; background: #176f67; border-radius: inherit; transition: width .6s ease; }
.progress-panel.is-failed .progress-fill { background: #af654b; }
.status .progress-time, .status .progress-note { color: #708781; font-size: 17px; margin-top: 8px; }
.progress-time { font-variant-numeric: tabular-nums; }
.result-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.result-heading .download { white-space: nowrap; font-size: 15px; }
.download-options { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.status .download-options { min-width: 172px; }
.full-download { color: #176f67; font-size: 17px; text-underline-offset: 3px; }
.panel-head .risk-note { margin-top: 6px; font-size: 17px; }
#mapping-records { list-style: none; padding: 12px 26px; margin: 0; }
#mapping-records li { padding: 10px 0; overflow-wrap: anywhere; }
#mapping-records small { display: block; color: #637c77; margin-top: 4px; }
#on-target-panel table { min-width: 520px; }
#table-panel th { white-space: normal; min-width: 82px; }
#table-panel th:nth-child(n+5) { min-width: 145px; max-width: 220px; }
#result-body a:any-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}
#result-body a:hover { text-decoration-thickness: 2px; }
#result-body a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.table-error { display: flex; align-items: center; gap: 12px; padding: 16px 26px; color: #8c533e; }
.table-error button { font-size: 17px; padding: 8px 12px; }
.table-wrap { max-height: 480px; }
.task-link-panel { margin-top: 16px; }
.task-link-panel label { margin-bottom: 6px; font-size: 17px; }
.task-link-row { display: flex; align-items: flex-start; gap: 10px; }
.task-link-row input { min-width: 0; flex: 1; font-size: 17px; }
.task-link-row button { flex-shrink: 0; min-width: 128px; font-size: 17px; }
.task-link-row .download-options { align-self: flex-start; }
.task-link-panel small { display: block; margin-top: 6px; color: #708781; }
.queue-panel { margin-top: 22px; padding: 18px; border: 1px solid #dbe8e4; border-radius: 12px; background: #f8fcfb; }
.queue-panel .progress-heading { flex-wrap: wrap; }
.queue-panel p, #queue-count { color: #637c77; font-size: 17px; }
#queue-wait { font-weight: 700; color: #176f67; margin-top: 12px; }
.queue-panel #queue-time { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .progress-fill { transition: none; }
}

.hidden {
  display: none !important;
}

.result-table {
  margin-top: 24px;
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  font-size: 16px;
}

th {
  background: #183b3a;
  color: #fff;
  text-align: left;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #dbe8e4;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f4faf8;
}

@media (max-width: 700px) {
  .panel {
    width: 100%;
    margin-left: 0;
  }

  #job-form {
    width: 100%;
    margin-top: 24px;
    margin-left: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
  .intro { grid-template-columns: 1fr; gap: 18px; margin-bottom: 14px; }
  .intro-copy > p:last-child { white-space: normal; }
  .hero-mosquito-frame,
  html[lang="en"] .hero-mosquito-frame { width: 166px; height: 166px; justify-self: start; margin-right: 0; transform: none; }
  .hero-mosquito { width: 154px; }

  .actions,
  .status {
    align-items: stretch;
    flex-direction: column;
  }

  .result-heading, .table-error { flex-direction: column; align-items: stretch; }
  .task-link-row { flex-direction: column; }

  .actions button,
  .download {
    text-align: center;
    width: 100%;
  }
}

.hero-mosquito {
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.hero-mosquito.is-loaded {
  opacity: 1;
}

/* Instructions link and guide page */
.help-nav,
.help-link {
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-nav { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.help-link {
  border: 1px solid #cfe1dc;
  border-radius: 8px;
  padding: 6px 11px;
  color: #176f67;
  font-size: .88rem;
  font-weight: 650;
  text-decoration: none;
}
.help-link:hover { background: #eaf6f1; }
.help-link:focus-visible, .help-page a:focus-visible { outline: 2px solid #176f67; outline-offset: 3px; }
.help-page header .brand { color: inherit; text-decoration: none; }
.help-intro {
  padding: clamp(18px, 4vw, 36px);
  margin-bottom: 16px;
  border: 1px solid #cfe1dc;
  border-radius: 14px;
  background: linear-gradient(120deg, #fff, #e7f4ee);
}
.help-page h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.4rem); }
.help-lead { color: #526d68; margin: 10px 0 0; max-width: 64ch; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 22px; }
.help-toc a { padding: 5px 10px; border-radius: 6px; background: #e5f2ed; color: #17665e; font-size: .83rem; }
.help-section {
  margin: 0 0 16px;
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid #cfe1dc;
  border-radius: 12px;
  background: white;
}
.help-section h2 { margin: 0 0 8px; font-size: 1.23rem; }
.help-section p, .help-section ul, .help-data { margin: 12px 0 0; }
.help-section p, .help-section li, .help-data { font-size: .93rem; line-height: 1.85; }
.help-example { min-width: 0; margin: 16px 0 0; border: 1px solid #d6e7e1; border-radius: 8px; background: #f8fcfa; }
.help-example-head, .help-example-body { padding: 12px; }
.help-example-head { border-bottom: 1px solid #d6e7e1; }
.help-example-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.help-example figcaption { margin: 0; padding: 8px 12px 12px; color: #526d68; font-size: .78rem; line-height: 1.65; }
.help-mark {
  display: inline-block;
  padding: 2px 6px;
  border: 2px solid #b4742e;
  border-radius: 5px;
  background: #fff6e4;
  color: #5a3412;
  font-size: .78rem;
}
.help-table-wrap { overflow: auto; }
.help-table { width: 100%; font-size: .82rem; font-variant-numeric: tabular-nums; }
.help-table th, .help-table td { padding: 10px; text-align: center; }
.help-table th { color: white; background: #173b38; white-space: normal; }
.help-table td { background: white; }
.help-sort {
  display: block;
  width: max-content;
  margin: 0 auto 6px;
  padding: 3px 8px;
  border: 1px solid #c4dcd5;
  border-radius: 4px;
  font-size: .72rem;
}
.help-sort.active { background: #e5f5f1; color: #173b38; }
.help-demo-fields { display: grid; gap: 10px; font-size: .82rem; }
.help-demo-fields div { display: grid; gap: 3px; }
.help-demo-fields strong { padding: 4px 8px; border: 1px solid #cfe1dc; border-radius: 5px; background: white; font-weight: 600; }
.help-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 14px 0 0; }
.help-metrics div { padding: 10px 12px; border-radius: 6px; background: #ecf6f1; font-size: .83rem; }
.help-metrics dt { font-weight: 700; }
.help-metrics dd { margin: 6px 0 0; color: #405f58; line-height: 1.65; }
.help-shot { margin-bottom: 12px; overflow: hidden; }
.help-shot img { width: 100%; height: auto; display: block; }
.help-shot-detail { overflow: auto; }
.help-detail-chinese, html:lang(zh) .help-detail-english { display: none; }
html:lang(zh) .help-detail-chinese { display: block; }
.help-overview { padding: 14px 12px 4px; }
.help-overview img { border: 1px solid #e1ece8; border-radius: 7px; background: white; }
.help-pan-example { height: 9px; margin-top: 7px; border-radius: 10px; background: #8cbab3; }
.help-map-legend, .help-section .help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding: 0;
  list-style: none;
}
.help-map-legend { margin: 10px 0; color: #42625b; }
.help-section .help-map-legend li { font-size: .8rem; }
.help-map-legend li::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  background: #15803d;
}
.help-map-legend .help-has-snp::before { background: #b91c1c; }
.help-map-legend .help-pam::before { width: 4px; background: #8b5cf6; }
.help-ui-button {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 6px;
  background: #176f67;
  color: white;
  font-size: .82rem;
  font-weight: 650;
}
.help-ucsc-example { display: flex; justify-content: flex-end; }
.help-section .help-actions li { padding: 4px 8px; border-radius: 5px; background: #eaf5ef; font-size: .79rem; }
.help-data > div { padding: 12px 0; border-top: 1px solid #dfebe7; }
.help-data dt { font-weight: 700; }
.help-data dd { margin: 4px 0 0; color: #526d68; }
.help-note { color: #526d68; }
@media (max-width: 700px) {
  .help-metrics { grid-template-columns: 1fr; }
  .help-shot-detail img { min-width: 660px; }
}
