/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Dark Theme (default) ===== */
:root, [data-theme="dark"] {
  --bg:           #0b0b19;
  --surface:      rgba(255,255,255,0.035);
  --surface-hover: rgba(255,255,255,0.06);
  --border:       rgba(255,255,255,0.07);
  --text:         #e4e4eb;
  --text-muted:   #8b8b9e;
  --accent:       #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow:  rgba(108,92,231,0.35);
  --success:      #00cec9;
  --radius:       18px;
  --radius-sm:    10px;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --card-title:   #fff;
  --table-head-bg: rgba(108,92,231,0.15);
  --tooltip-bg:   rgba(26,26,46,0.95);
  --chart-border: rgba(11,11,25,0.6);
  --blob-opacity: 0.35;
  --png-bg:       #ffffff;
  --png-title:    #1a1a2e;
  --png-text:     #333;
}

/* ===== Light Theme ===== */
[data-theme="light"] {
  --bg:           #f3f4f8;
  --surface:      rgba(255,255,255,0.85);
  --surface-hover: rgba(255,255,255,0.95);
  --border:       rgba(0,0,0,0.08);
  --text:         #1a1a2e;
  --text-muted:   #6b6b80;
  --accent:       #6c5ce7;
  --accent-light: #5a4bd1;
  --accent-glow:  rgba(108,92,231,0.2);
  --success:      #00a89e;
  --card-title:   #1a1a2e;
  --table-head-bg: rgba(108,92,231,0.1);
  --tooltip-bg:   rgba(255,255,255,0.95);
  --chart-border: rgba(255,255,255,0.8);
  --blob-opacity: 0.15;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background 0.3s, color 0.3s;
}

/* ===== Blobs ===== */
.blob { position: fixed; border-radius: 50%; filter: blur(130px); opacity: var(--blob-opacity); pointer-events: none; z-index: 0; transition: opacity 0.3s; }
.blob-1 { width: 550px; height: 550px; background: var(--accent); top: -180px; left: -120px; animation: blobFloat 20s ease-in-out infinite alternate; }
.blob-2 { width: 420px; height: 420px; background: #00cec9; bottom: -100px; right: -120px; animation: blobFloat 24s ease-in-out infinite alternate-reverse; }
.blob-3 { width: 320px; height: 320px; background: #fd79a8; top: 50%; left: 60%; animation: blobFloat 28s ease-in-out infinite alternate; }
@keyframes blobFloat { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(50px,35px) scale(1.18); } }

/* ===== Header ===== */
header { position: relative; z-index: 1; text-align: center; padding: 40px 20px 24px; }
.home-link {
  position: absolute; top: 16px; left: 20px;
  color: var(--accent-light); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  transition: color 0.2s; opacity: 0.8;
}
.home-link:hover { opacity: 1; color: var(--card-title); }
.header-inner { display: inline-flex; align-items: center; gap: 18px; }
.header-logo { width: 72px; height: 72px; flex-shrink: 0; border-radius: 50%; object-fit: cover; box-shadow: 0 0 20px var(--accent-glow); }
header h1 {
  font-size: 2.5rem; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--card-title) 30%, var(--accent-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.subtitle { margin-top: 6px; color: var(--text-muted); font-size: 0.95rem; }

/* Theme toggle */
.theme-toggle {
  position: absolute; top: 16px; right: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  width: 42px; height: 42px; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.theme-toggle:hover { background: var(--surface-hover); transform: scale(1.1); }

/* ===== Main ===== */
main { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 0 20px 40px; display: flex; flex-direction: column; gap: 22px; }

/* ===== Card ===== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s; animation: fadeUp 0.45s ease both;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(0,0,0,0.15); }
@keyframes fadeUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }
.card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; color: var(--card-title); }

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 48px 20px;
  text-align: center; cursor: pointer; transition: border-color 0.25s, background 0.25s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: rgba(108,92,231,0.06); }
.upload-icon { color: var(--accent-light); margin-bottom: 14px; }
.upload-text { font-size: 1.05rem; }
.upload-or { color: var(--text-muted); font-size: 0.85rem; margin: 10px 0; }
.upload-hint { margin-top: 14px; color: var(--text-muted); font-size: 0.8rem; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 26px; background: linear-gradient(135deg, var(--accent), #7c6cf0);
  color: #fff; border: none; border-radius: 8px; font-family: var(--font);
  font-weight: 600; font-size: 0.92rem; cursor: pointer;
  transition: box-shadow 0.25s, transform 0.2s;
}
.btn-primary:hover { box-shadow: 0 4px 22px var(--accent-glow); transform: translateY(-1px); }
.btn-sm {
  padding: 5px 14px; background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted); font-size: 0.78rem; font-family: var(--font);
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.btn-sm:hover { background: rgba(108,92,231,0.15); color: var(--accent-light); }

[data-theme="light"] .btn-sm { background: rgba(0,0,0,0.04); }
[data-theme="light"] .btn-sm:hover { background: rgba(108,92,231,0.1); }

/* File Info Bar */
.file-info {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: rgba(108,92,231,0.08); border: 1px solid rgba(108,92,231,0.2);
  border-radius: var(--radius-sm); margin-top: 16px; animation: fadeUp 0.3s ease both;
}
.file-icon { font-size: 1.3rem; }
.file-name { font-weight: 600; font-size: 0.95rem; color: var(--card-title); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-rows { font-size: 0.82rem; color: var(--accent-light); white-space: nowrap; }
.btn-clear {
  background: none; border: none; color: var(--text-muted); font-size: 1.1rem;
  cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: background 0.2s, color 0.2s;
}
.btn-clear:hover { background: rgba(255,255,255,0.1); color: #ff6b6b; }

/* ===== Stats Card ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-box {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; transition: background 0.2s;
}
[data-theme="light"] .stat-box { background: rgba(0,0,0,0.02); }
.stat-box:hover { background: rgba(108,92,231,0.08); }
.stat-box .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--accent-light); }
.stat-box .stat-name { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.stats-sub-title { font-size: 0.95rem; font-weight: 700; color: var(--card-title); margin: 18px 0 10px; }
.numeric-stats-scroll { max-height: 300px; }
.numeric-stats-table { font-size: 0.82rem; }
.numeric-stats-table thead th { background: var(--table-head-bg); color: var(--accent-light); font-weight: 600; padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.numeric-stats-table tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }

/* ===== Controls ===== */
.controls-hint { color: var(--text-muted); font-size: 0.86rem; margin-bottom: 12px; }
select {
  width: 100%; padding: 12px 16px; background: rgba(255,255,255,0.05);
  color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; cursor: pointer; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b8b9e' viewBox='0 0 16 16'%3E%3Cpath d='M8 10.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
[data-theme="light"] select { background-color: rgba(255,255,255,0.7); }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
select option { background: var(--bg); color: var(--text); }

/* ===== Filter ===== */
.filter-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; flex-wrap: wrap; gap: 10px; }
.filter-header h2 { margin-bottom: 0; }
.filter-actions { display: flex; gap: 8px; }

.filter-search-wrap { margin-bottom: 12px; }
.filter-search {
  width: 100%; padding: 10px 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 0.88rem;
  outline: none; transition: border-color 0.2s;
}
[data-theme="light"] .filter-search { background: rgba(255,255,255,0.7); }
.filter-search:focus { border-color: var(--accent); }
.filter-search::placeholder { color: var(--text-muted); }

.filter-checks { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.filter-checks::-webkit-scrollbar { width: 5px; }
.filter-checks::-webkit-scrollbar-track { background: transparent; }
.filter-checks::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.filter-check-item {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: background 0.2s, border-color 0.2s; font-size: 0.85rem;
}
[data-theme="light"] .filter-check-item { background: rgba(0,0,0,0.03); }
.filter-check-item:hover { background: rgba(108,92,231,0.1); border-color: rgba(108,92,231,0.3); }
.filter-check-item.hidden { display: none; }
.filter-check-item input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.check-label { color: var(--text); font-weight: 500; }
.check-count { color: var(--text-muted); font-size: 0.75rem; background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 10px; }

/* ===== Options ===== */
.options-row { display: flex; flex-wrap: wrap; gap: 20px; }
.option-group { flex: 1; min-width: 200px; }
.option-label { display: block; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.toggle-group { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle-btn {
  padding: 7px 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted); font-size: 0.82rem; font-family: var(--font);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
[data-theme="light"] .toggle-btn { background: rgba(0,0,0,0.03); }
.toggle-btn:hover { background: rgba(108,92,231,0.1); color: var(--text); }
.toggle-btn.active { background: rgba(108,92,231,0.2); border-color: var(--accent); color: var(--accent-light); font-weight: 600; }

/* ===== Chart ===== */
.chart-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.chart-header h2 { margin-bottom: 0; }
.chart-actions { display: flex; gap: 8px; align-items: center; }
.btn-download { font-size: 0.82rem; padding: 8px 18px; }
.btn-download svg { flex-shrink: 0; }
.btn-share { font-size: 0.82rem; padding: 7px 14px; }

.chart-layout { display: flex; gap: 24px; align-items: center; justify-content: center; flex-wrap: wrap; }
.chart-layout.side-mode .chart-wrapper { flex: 0 0 auto; }
.chart-layout.side-mode .side-legend { display: block; }
.chart-layout:not(.side-mode) .side-legend { display: none; }

.chart-wrapper { max-width: 520px; width: 100%; position: relative; }

.side-legend {
  flex: 0 0 260px; max-height: 480px; overflow-y: auto;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; display: none;
}
[data-theme="light"] .side-legend { background: rgba(0,0,0,0.02); }
.side-legend::-webkit-scrollbar { width: 4px; }
.side-legend::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.legend-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 0.84rem; border-bottom: 1px solid rgba(255,255,255,0.03); }
[data-theme="light"] .legend-item { border-bottom-color: rgba(0,0,0,0.04); }
.legend-item:last-child { border-bottom: none; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; margin-top: 2px; }
.legend-text { color: var(--text); font-weight: 500; flex: 1; word-break: break-word; line-height: 1.3; }
.legend-pct { color: var(--accent-light); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.legend-count { color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; }

.chart-stats { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.stat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 20px; font-size: 0.8rem; color: var(--text-muted); transition: background 0.2s; }
.stat-chip:hover { background: rgba(255,255,255,0.08); }
.stat-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.stat-label { font-weight: 600; color: var(--text); }




/* ===== Export Card ===== */
.export-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.export-field { flex: 1; min-width: 200px; }
.export-preview {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; margin-bottom: 14px;
  background: rgba(0,206,201,0.1); border: 1px solid rgba(0,206,201,0.2);
  border-radius: 8px; font-size: 0.88rem; color: var(--success); font-weight: 600;
}
.btn-export { margin-top: 4px; }
.btn-export:disabled { opacity: 0.4; cursor: not-allowed; }
.export-checks { max-height: 240px; overflow-y: auto; }

/* ===== Data Table ===== */
.table-header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.table-header-row h2 { margin-bottom: 0; }
.table-actions { display: flex; gap: 8px; }
.badge { font-size: 0.75rem; background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 12px; font-weight: 600; vertical-align: middle; margin-left: 6px; }
.table-scroll { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); max-height: 440px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
thead th {
  position: sticky; top: 0; background: var(--table-head-bg); color: var(--accent-light); font-weight: 600;
  padding: 12px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); z-index: 2;
  cursor: pointer; user-select: none; transition: background 0.2s;
}
thead th:hover { background: rgba(108,92,231,0.25); }
thead th .sort-arrow { font-size: 0.7rem; margin-left: 4px; opacity: 0.5; }
thead th.sort-active .sort-arrow { opacity: 1; }
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
[data-theme="light"] tbody tr:hover { background: rgba(0,0,0,0.02); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.hidden-row { display: none; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--accent); color: #fff; padding: 12px 24px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600; font-family: var(--font);
  box-shadow: 0 8px 30px var(--accent-glow); z-index: 9999;
  opacity: 0; transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== Footer ===== */
footer { position: relative; z-index: 1; text-align: center; padding: 36px 20px 30px; border-top: 1px solid var(--border); margin-top: 20px; color: var(--text-muted); font-size: 0.88rem; }
footer strong { color: var(--accent-light); font-weight: 700; }
.footer-logo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; box-shadow: 0 0 14px var(--accent-glow); }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.84rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-light); }

/* ===== Sequence Tools ===== */

/* Textarea for sequence input */
.seq-textarea {
  width: 100%; padding: 14px 16px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: 'Courier New', monospace; font-size: 0.88rem;
  resize: vertical; outline: none; transition: border-color 0.2s;
  line-height: 1.6;
}
[data-theme="light"] .seq-textarea { background: rgba(255,255,255,0.7); }
.seq-textarea:focus { border-color: var(--accent); }
.seq-textarea::placeholder { color: var(--text-muted); font-family: var(--font); }

.seq-error {
  margin-top: 12px; padding: 10px 16px; background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.3); border-radius: 8px;
  color: #ff6b6b; font-size: 0.88rem; font-weight: 600;
}

/* Sequence display box (reverse complement, protein) */
.seq-display-box {
  padding: 14px 16px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace; font-size: 0.82rem;
  color: var(--accent-light); line-height: 1.8;
  white-space: pre-wrap; word-break: break-all;
  max-height: 200px; overflow-y: auto;
}
[data-theme="light"] .seq-display-box { background: rgba(0,0,0,0.02); color: var(--accent); }

/* Base composition stats */
.base-stats-grid { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.base-stat { font-size: 0.92rem; display: flex; align-items: center; gap: 8px; }
.base-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* Codon table mini bars */
.mini-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
[data-theme="light"] .mini-bar { background: rgba(0,0,0,0.06); }
.mini-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--success)); border-radius: 4px; transition: width 0.4s ease; }

/* 6-Frame translation */
.frames-container { display: flex; flex-direction: column; gap: 12px; }
.frame-card {
  padding: 14px 16px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.frame-card:hover { background: rgba(108,92,231,0.06); }
.frame-label { font-size: 0.78rem; font-weight: 700; color: var(--accent-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.frame-seq {
  font-family: 'Courier New', monospace; font-size: 0.78rem; color: var(--text-muted);
  word-break: break-all; line-height: 1.7;
}
.stop-codon { color: #ff6b6b; font-weight: 700; }

/* ===== ORF Finder – Genome Browser ===== */
.genome-browser { padding: 10px 0; }
.genome-ruler {
  display: flex; justify-content: space-between; padding: 0 60px 6px 60px;
  font-size: 0.72rem; color: var(--text-muted);
}
.genome-track { display: flex; align-items: center; margin-bottom: 6px; height: 28px; }
.track-label {
  width: 52px; flex-shrink: 0; font-size: 0.76rem; font-weight: 700;
  color: var(--text-muted); text-align: right; padding-right: 8px;
}
.track-bar {
  flex: 1; height: 22px; position: relative;
  background: rgba(255,255,255,0.04); border-radius: 4px;
  border: 1px solid var(--border);
}
[data-theme="light"] .track-bar { background: rgba(0,0,0,0.03); }
.orf-bar {
  position: absolute; top: 2px; height: 16px; border-radius: 3px;
  cursor: pointer; opacity: 0.8; transition: opacity 0.2s, transform 0.2s;
  min-width: 3px;
}
.orf-bar:hover { opacity: 1; transform: scaleY(1.3); z-index: 2; }
.orf-bar.orf-selected { opacity: 1; outline: 2px solid #fff; outline-offset: 1px; z-index: 3; }

/* ===== Restriction Map ===== */
.restriction-map { padding: 10px 0; }
.rmap-ruler {
  display: flex; justify-content: space-between; padding: 0 60px 8px 60px;
  font-size: 0.72rem; color: var(--text-muted);
}
.rmap-track { display: flex; align-items: center; margin-bottom: 8px; height: 24px; }
.rmap-label {
  width: 56px; flex-shrink: 0; font-size: 0.74rem; font-weight: 700;
  text-align: right; padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rmap-bar {
  flex: 1; height: 10px; position: relative;
  background: rgba(255,255,255,0.06); border-radius: 5px;
  border: 1px solid var(--border);
}
[data-theme="light"] .rmap-bar { background: rgba(0,0,0,0.04); }
.rmap-cut {
  position: absolute; top: -5px; width: 3px; height: 20px;
  border-radius: 1px; transform: translateX(-1px);
}

/* ===== Gel Electrophoresis ===== */
.gel-container { overflow-x: auto; padding: 10px 0; }
.gel-wrapper {
  display: flex; gap: 0; min-width: fit-content;
  background: linear-gradient(180deg, #1a1a2e 0%, #0d0d1a 100%);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  padding: 10px 6px;
}
[data-theme="light"] .gel-wrapper {
  background: linear-gradient(180deg, #e8e8f0 0%, #d0d0dd 100%);
}
.gel-lane {
  flex: 0 0 70px; display: flex; flex-direction: column; align-items: center;
}
.gel-lane-label {
  font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
  margin-bottom: 6px; text-align: center; white-space: nowrap;
  max-width: 64px; overflow: hidden; text-overflow: ellipsis;
}
.gel-lane-track {
  position: relative; width: 40px; height: 320px;
  background: rgba(255,255,255,0.03); border-radius: 3px;
}
[data-theme="light"] .gel-lane-track { background: rgba(0,0,0,0.03); }
.gel-band {
  position: absolute; left: 4px; right: 4px; height: 4px;
  border-radius: 2px; transition: opacity 0.2s;
}
.gel-ladder-band { background: rgba(255,255,255,0.4); height: 2px; }
[data-theme="light"] .gel-ladder-band { background: rgba(0,0,0,0.35); }
.gel-size {
  position: absolute; left: calc(100% + 4px); top: -4px;
  font-size: 0.6rem; color: var(--text-muted); white-space: nowrap;
  pointer-events: none;
}
.gel-band:hover { opacity: 1 !important; }

/* ===== Responsive ===== */
@media (max-width: 700px) {
  header h1 { font-size: 1.6rem; }
  .card { padding: 20px; }
  .upload-zone { padding: 30px 16px; }
  .chart-wrapper { max-width: 100%; }
  .chart-layout { flex-direction: column; }
  .side-legend { flex: 0 0 auto; width: 100%; max-height: 200px; }
  .options-row { flex-direction: column; }
  .theme-toggle { top: 12px; right: 12px; width: 36px; height: 36px; }
}