body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f9fa;
}
.header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
h1 {
    color: #2c3e50;
    margin: 0;
    font-weight: 500;
}
a:link {
  text-decoration: none;
  color: #0000EE;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

a:visited {
  text-decoration: none;
  color: #0000EE;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

a:hover {
  text-decoration: underline;
  color: #FF0000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

a:active {
  text-decoration: underline;
  color: #FF0000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.controls-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group.file-input {
    flex: 2;
}
.form-group.source-select {
    flex: 1;
    max-width: 200px;
}
label, select, input {
	margin: 5px;
}
#result { 
	margin-top: 15px; font-weight: bold;
}
#plotContainer {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}
#statsContainer {
    background-color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
#statsContainer h3 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 16px;
}
.error {
    color: #dc3545;
    padding: 15px;
    background-color: #f8d7da;
    border-radius: 4px;
    margin-top: 10px;
    border: 1px solid #f5c6cb;
}
.content-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.stats-table td {
    padding: 4px 8px;
}
.stats-table td:first-child {
    font-weight: 500;
    width: 40%;
}
.company-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #495057;
    flex-shrink: 0;
}
.company-info img {
    height: 30px;
    width: auto;
}
.stats-inline {
    display: flex;
    gap: 20px;
}
.stat-item {
    display: flex;
    gap: 8px;
}
.stat-label {
    font-weight: 500;
    color: #495057;
}
.median-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 20px;
}

.median-button:hover {
    background-color: #45a049;
}
/* ── App description box ─────────────────────────────────────────────────── */
.app-description {
    background: white;
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #495057;
}
.app-description ul {
    margin: 4px 0 0 0;
    padding-left: 18px;
}
.app-description li {
    margin-bottom: 2px;
}

/* ── App navigation (hamburger) ──────────────────────────────────────────── */
.app-nav {
  position: relative;
}
.nav-toggle {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #2c3e50;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.nav-toggle:hover { background: #e9ecef; }
.nav-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  min-width: 190px;
  z-index: 200;
}
.app-nav.open .nav-menu { display: block; }
.nav-menu li a {
  display: block;
  padding: 9px 16px;
  color: #2c3e50;
  font-size: 14px;
}
.nav-menu li a:hover { background: #f8f9fa; text-decoration: none; }
.nav-menu li a.current { font-weight: 600; color: #4CAF50; pointer-events: none; }

.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: grey;
  font-size: 11px;
  color: white;
}
.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
  padding: 4px 20px;
  gap: 4px 24px;
}

/* ── Upload area & progress bar (readcount, fastqstats) ─────────────────── */
#uploadArea {
  border: 2px dashed #ced4da;
  border-radius: 8px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  background: white;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 15px;
}
#uploadArea.drag-over { border-color: #4CAF50; background: #f0fff0; }
#uploadArea p { margin: 0 0 8px 0; color: #495057; }
#uploadArea .hint { font-size: 12px; color: #868e96; }
#fileInput { display: none; }
#progressWrap { display: none; margin-bottom: 15px; }
#progressLabel { font-size: 13px; color: #495057; margin-bottom: 6px; }
#progressBar {
  width: 100%;
  height: 8px;
  appearance: none;
  border-radius: 4px;
  overflow: hidden;
}
#progressBar::-webkit-progress-bar   { background: #e9ecef; border-radius: 4px; }
#progressBar::-webkit-progress-value { background: #4CAF50; border-radius: 4px; }
#progressBar::-moz-progress-bar      { background: #4CAF50; border-radius: 4px; }
#results { display: none; }
#errorBox .error { margin-top: 0; }
canvas { max-height: 420px; }

/* ── stats-table header & zebra rows (readcount) ─────────────────────────── */
.stats-table th {
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
  padding: 4px 8px;
}
.stats-table tr:nth-child(even) td { background: #f8f9fa; }
#summary { font-size: 13px; color: #495057; margin-bottom: 10px; }

/* ── Charts grid & stat summary boxes (fastqstats) ───────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 60px;
}
.chart-wide { grid-column: 1 / -1; }
.charts-grid canvas { max-height: 320px; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.stat-box {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px 10px;
  text-align: center;
}
.stat-box .value { font-size: 20px; font-weight: 600; color: #2c3e50; line-height: 1.2; }
.stat-box .label { font-size: 11px; color: #868e96; margin-top: 4px; }
.encoding-note { font-size: 12px; color: #495057; margin-top: 8px; }
.encoding-note.warn { color: #e67e22; }

/* ── Tool cards (seqtools and future tool pages) ─────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}
.tool-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 20px;
}
.tool-card h2 {
  color: #2c3e50;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}
.tool-card h3 {
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 14px 0;
}
.tool-card textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: monospace;
  font-size: 13px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 8px;
  resize: vertical;
  margin: 0;
}
.tool-card input[type="number"],
.tool-card select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.tool-card label {
  display: block;
  font-size: 12px;
  color: #495057;
  margin: 12px 0 4px 0;
}
.tool-card label:first-of-type { margin-top: 0; }
.output-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 13px;
  min-height: 36px;
  word-break: break-all;
  margin-top: 12px;
  color: #2c3e50;
}
.output-box.empty { color: #adb5bd; font-family: inherit; font-style: italic; }
.result-table { width: 100%; margin-top: 12px; border-collapse: collapse; }
.result-table tr { border-bottom: 1px solid #f0f0f0; }
.result-table tr:last-child { border-bottom: none; }
.result-table td { padding: 5px 2px; font-size: 13px; }
.result-table td:first-child { color: #495057; }
.result-table td:last-child { font-weight: 600; color: #2c3e50; text-align: right; }
.tool-note { font-size: 11px; color: #868e96; margin-top: 10px; }
.warn { color: #e67e22; }
.input-warn {
  font-size: 12px;
  color: #dc3545;
  margin-top: 5px;
  min-height: 16px;
}

/* ── Info button & modal ─────────────────────────────────────────────────── */
.info-btn {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 50%;
  background: #e9ecef;
  color: #495057;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  user-select: none;
}
.info-btn:hover { background: #ced4da; }
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 24px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  font-size: 13px;
  color: #2c3e50;
  line-height: 1.6;
}
.modal h3 {
  margin: 0 0 14px 0;
  font-size: 14px;
  color: #2c3e50;
}
.modal ol { margin: 0; padding-left: 18px; }
.modal li { margin-bottom: 14px; }
.modal .formula {
  font-family: monospace;
  background: #f8f9fa;
  border-radius: 3px;
  padding: 2px 6px;
  display: inline-block;
  margin: 2px 0;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #868e96;
  line-height: 1;
}
.modal-close:hover { color: #2c3e50; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wide  { grid-column: 1; }
}
@media (max-width: 600px) {
    body { padding: 12px; }
    h1 { font-size: 20px; }
    .company-info span { display: none; }   /* hide text label, keep logo + hamburger */
    .company-info img  { height: 24px; }
}
