/* The sidebar Vinchi approved (study C). Every version keeps it as is. */
:root {
  --ink: #0b0b0b;
  --muted: #8a8a85;
  --line: #e7e6e1;
  --accent: #ff4f00;
  --good: #2f8a3a;
  --bad: #e0352b;
  --bg: #ffffff;
  --paper: #f6f5f1;
  --field: #fafaf8;
  --soft: #55544e;
  --tile-good-bg: #e3f1d8;
  --tile-good: #2c6e2c;
  --tile-bad-bg: #fbe0d9;
  --tile-bad: #c2331f;
  --spot-bg: #fbfaf7;
  --spot-bg-main: #efede6;
  --spot-line: #dedbd1;
  color-scheme: light;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
[data-theme="dark"] {
  --ink: #edece5;
  --muted: #86857c;
  --line: #2a2b26;
  --good: #7fc45c;
  --bad: #ff6a4d;
  --bg: #0f100e;
  --paper: #161713;
  --field: #1b1c18;
  --soft: #b6b4aa;
  --tile-good-bg: #24341c;
  --tile-good: #c2e6a0;
  --tile-bad-bg: #38201a;
  --tile-bad: #ff9c85;
  --spot-bg: #1b1c18;
  --spot-bg-main: #1f201b;
  --spot-line: #2f302a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }

.app { display: grid; grid-template-columns: 340px 1fr; min-height: 100vh; }

.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 32px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--bg); z-index: 2; }
.side > * { flex-shrink: 0; }
.brand { font: 800 20px var(--sans); letter-spacing: -0.03em; }
.brand i { color: var(--accent); font-style: normal; }
.side h1 { font: 600 30px/1.08 var(--sans); letter-spacing: -0.03em; margin: 48px 0 40px; }
.k { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
#count { font-weight: 400; }
.side textarea { width: 100%; height: 140px; border: 1px solid var(--line); background: var(--field); resize: none; outline: none; padding: 12px; font: 500 15px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 28px; }
.side textarea:focus { border-color: var(--ink); }
.targets { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); margin-bottom: 28px; }
.targets label { cursor: pointer; }
.targets input { display: none; }
.targets span { display: block; text-align: center; padding: 10px 0; font: 700 12px var(--mono); letter-spacing: 0.06em; color: var(--muted); }
.targets label + label span { border-left: 1px solid var(--line); }
.targets input:checked + span { background: var(--ink); color: var(--bg); }
.range { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.range input { flex: 1; accent-color: var(--accent); }
.range output { font: 800 22px var(--sans); color: var(--accent); width: 18px; }
.go { background: var(--ink); color: var(--bg); border: 0; padding: 16px; font-weight: 600; cursor: pointer; }
.go:hover { background: var(--accent); color: #fff; }
.legend { margin-top: auto; display: flex; justify-content: space-between; font: 700 13px var(--mono); padding-top: 24px; border-top: 1px solid var(--line); }
.legend span { display: grid; text-align: center; gap: 2px; }
.legend small { font: 500 10px var(--sans); color: var(--muted); }

.main { min-width: 0; }
.genes i { font-style: normal; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 24px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* Logo row: the X link and the light/dark switch */
.side-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-top nav { display: flex; gap: 8px; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; background: none; border: 1px solid var(--line); color: var(--ink); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.icon-btn svg { width: 15px; height: 15px; fill: currentColor; }
.icon-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
[data-theme="dark"] .icon-btn .moon { display: none; }
