/* Nucleïnezuren-atlas — zelfde donkere visuele taal als de rest van de app */
html, body { height: 100%; }
body { overflow: hidden; font-size: 14px; }
[hidden] { display: none !important; }
button { font-family: inherit; }

/* ---------- kopbalk ---------- */
.top { height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: rgba(13,20,38,.9); }
.top a { text-decoration: none; }
.back { font-weight: 600; font-size: 13.5px; color: #0a1224; background: var(--accent); padding: 8px 14px; border-radius: 9px; white-space: nowrap; }
.back:hover { filter: brightness(1.1); }
.home, .story { font-size: 13px; color: var(--muted); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; white-space: nowrap; }
.home:hover, .story:hover { color: var(--text); border-color: rgba(124,196,255,.5); }
.ttl { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ttl b { font-size: 16px; letter-spacing: -.01em; }
.ttl span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp { flex: 1; }
.lang { all: unset; cursor: pointer; font: 500 11px var(--mono); padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); margin-left: 4px; }
.lang[aria-pressed=true] { color: var(--text); border-color: rgba(124,196,255,.5); background: rgba(124,196,255,.1); }

/* ---------- raster ---------- */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 390px; height: calc(100vh - 54px); }
.side, .main, .info { overflow-y: auto; min-height: 0; }
.side { border-right: 1px solid var(--line); padding: 12px 12px 0; background: rgba(13,20,38,.5); display: flex; flex-direction: column; overflow: hidden; }
.side .list { flex: 1; overflow-y: auto; min-height: 120px; padding-bottom: 16px; margin: 0 -4px; padding-left: 4px; padding-right: 4px; }
.main { padding: 12px 16px 24px; }
.info { border-left: 1px solid var(--line); padding: 14px 18px 30px; background: rgba(13,20,38,.5); }

/* ---------- zijbalk ---------- */
.search input { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 8px 10px; font: 13.5px var(--font); outline: none; }
.search input:focus { border-color: rgba(124,196,255,.6); }
.fgrp { margin-top: 10px; }
.fgrp h4 { margin: 0 0 5px; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { all: unset; cursor: pointer; font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip:hover { color: var(--text); }
.chip[aria-pressed=true] { background: rgba(124,196,255,.16); color: var(--text); border-color: rgba(124,196,255,.55); }
.chip:focus-visible { outline: 2px solid var(--accent); }
.count { display: flex; justify-content: space-between; align-items: center; margin: 12px 2px 6px; font-size: 12px; color: var(--muted); }
.link { all: unset; cursor: pointer; color: var(--accent); font-size: 12px; }
.link:hover { text-decoration: underline; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.item { display: flex; gap: 9px; align-items: flex-start; padding: 8px 9px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.item:hover { background: rgba(124,196,255,.06); }
.item.on { background: rgba(124,196,255,.12); border-color: rgba(124,196,255,.4); }
.item.cmp { border-color: rgba(255,194,71,.45); background: rgba(255,194,71,.07); }
.item .dots { display: flex; flex-direction: column; gap: 3px; padding-top: 4px; }
.item .dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.item .tx { flex: 1; min-width: 0; }
.item .nm { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.item .sb { font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.item .pdb { font: 500 10.5px var(--mono); color: var(--accent); border: 1px solid var(--line); padding: 2px 5px; border-radius: 5px; white-space: nowrap; }
.item .pdb.no { color: var(--muted); }
.item .ck { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; margin-top: 2px; display: grid; place-items: center; font-size: 11px; color: #0a1224; flex: none; }
.item .ck.on { background: #ffc247; border-color: #ffc247; }

/* ---------- hoofdpaneel ---------- */
.head { display: flex; align-items: flex-start; gap: 14px; }
.htxt { flex: 1; min-width: 0; }
.head h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: rgba(160,180,220,.1); color: var(--muted); white-space: nowrap; }
.badge.pdbb { font-family: var(--mono); color: var(--accent); text-decoration: none; border: 1px solid rgba(124,196,255,.35); background: none; }
.badge.warn { background: rgba(240,107,192,.14); color: #f59ad6; font-weight: 600; }
.badge.t-dna { color: #9cc0ff; } .badge.t-rna { color: #ffb27a; } .badge.t-prot { color: #c3b1ff; } .badge.t-drug { color: #7fdc6a; } .badge.t-hybrid { color: #ffc247; }
.cmpBtn { all: unset; cursor: pointer; font-size: 13px; font-weight: 600; padding: 8px 13px; border-radius: 9px; border: 1px solid rgba(255,194,71,.45); color: #ffc247; white-space: nowrap; }
.cmpBtn[aria-pressed=true] { background: #ffc247; color: #0a1224; }
.cmpBtn:focus-visible { outline: 2px solid var(--accent); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.presets button { all: unset; cursor: pointer; font-size: 12px; padding: 4px 9px; border-radius: 7px; border: 1px solid rgba(255,194,71,.35); color: #ffd27a; }
.presets button:hover { background: rgba(255,194,71,.12); }
.cmpHint { margin-top: 6px; font-size: 12px; color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 12px 0 10px; }
.grp { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { all: unset; cursor: pointer; font-size: 12.5px; padding: 6px 10px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed=true] { background: rgba(124,196,255,.16); color: var(--text); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.togs { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tog { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tog input { accent-color: #7cc4ff; margin: 0; }

.slots { display: grid; grid-template-columns: 1fr; gap: 12px; }
.slots.n2 { grid-template-columns: 1fr 1fr; }
.slots.n3 { grid-template-columns: 1fr 1fr 1fr; }
/* diagrammen hebben leesbare tekst nodig: met drie kaarten komen ze in 2 kolommen (2 + 1) i.p.v. 3 smalle */
.slots.n3:has(.stage.dg) { grid-template-columns: 1fr 1fr; }
.slot { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.slot .sh { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.slot .sh h3 { margin: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .sh .hand { font: 500 10.5px var(--mono); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.hand.r { background: rgba(79,143,247,.16); color: #9cc0ff; }
.hand.l { background: rgba(240,107,192,.16); color: #f06bc0; }
.slot .sh .pdbl { margin-left: auto; font: 500 11px var(--mono); color: var(--muted); text-decoration: none; white-space: nowrap; }
.slot .sh .pdbl:hover { color: var(--accent); }
.slot .sh .x { all: unset; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.slot .sh .x:hover { color: var(--text); }
.stage { position: relative; height: clamp(360px, calc(100vh - 320px), 720px); }
.slots.n2 .stage, .slots.n3 .stage { height: clamp(300px, calc(100vh - 420px), 480px); }
.stage .load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 20px; pointer-events: none; }
.stage .hover { position: absolute; left: 10px; bottom: 10px; font: 500 11.5px var(--mono); background: rgba(7,11,22,.82); padding: 4px 8px; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2; }
.stage .diag { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; background: var(--bg-2); z-index: 3; overflow: auto; }
.stage .diag svg { width: 100%; height: 100%; max-height: 100%; }
/* schema's: hoogte volgt de verhouding van de tekening (geen lege band), legende als gewone tekst eronder */
.slots .stage.dg, .slots.n2 .stage.dg, .slots.n3 .stage.dg { height: auto; aspect-ratio: var(--ar, 4 / 3); max-height: clamp(300px, calc(100vh - 240px), 760px); }
.slots:not(.n2):not(.n3) .stage.dg { max-height: clamp(300px, calc(100vh - 360px), 640px); }
.stage.dg .diag { padding: 10px 14px; }
.dleg { padding: 10px 14px 12px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.dleg ul.dl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.dleg ul.dl li { display: flex; gap: 9px; align-items: flex-start; }
.dleg ul.dl i { flex: none; width: 14px; height: 14px; border-radius: 4px; margin-top: 3px; }
.dleg ul.dl i.ln { height: 5px; border-radius: 3px; margin-top: 8px; }
.dleg b { color: var(--text); font-weight: 600; }
.dleg ol.ds { margin: 10px 0 0; padding-left: 22px; }
.dleg ol.ds li { margin-bottom: 3px; }
.dleg ol.ds li::marker { color: var(--text); font-weight: 700; }
.dleg .dn { margin-top: 8px; font-size: 13px; }
.dleg .dn p { margin: 0 0 3px; }
/* smalle vergelijkkaarten: schema's (en 3D) onder elkaar i.p.v. te klein naast elkaar */
@media (max-width: 1080px) { .slots.n2, .slots.n3, .slots.n3:has(.stage.dg) { grid-template-columns: 1fr; } }
.stage .note3d { position: absolute; right: 10px; top: 10px; font-size: 11px; color: var(--muted); background: rgba(7,11,22,.75); padding: 3px 8px; border-radius: 6px; z-index: 2; pointer-events: none; }
.smeta { padding: 7px 12px 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.smeta code { font-family: var(--mono); color: var(--text); font-size: 11.5px; word-break: break-all; }

.calc { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.calc td { padding: 5px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.calc td:first-child { color: var(--muted); width: 46%; }
.calc td:last-child { text-align: right; font-family: var(--mono); font-size: 12px; }
.calc .ok { color: #7fdc6a; }
.calc .wr { color: #ffc247; }
.calc tr.sec td { font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); padding-top: 9px; background: rgba(124,196,255,.04); }
.calc tr.why td { font-family: var(--font); text-align: left; color: var(--muted); font-size: 12px; }
.sbody { display: grid; grid-template-columns: minmax(0, 1fr) 370px; }
.sview { min-width: 0; display: flex; flex-direction: column; }
.calcgrid { border-left: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 280px); }
.calcgrid:empty { display: none; }
.sbody:has(.calcgrid:empty) { grid-template-columns: 1fr; }
.calcgrid .calc:first-child tr:first-child td { border-top: 0; }
.slots.n2 .sbody, .slots.n3 .sbody { grid-template-columns: 1fr; }
.slots.n2 .calcgrid, .slots.n3 .calcgrid { border-left: 0; max-height: none; }
.slots.n2 .calcgrid .calc:first-child tr:first-child td, .slots.n3 .calcgrid .calc:first-child tr:first-child td { border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 2px 8px; min-height: 24px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- infokolom ---------- */
.info h2 { margin: 0 0 2px; font-size: 19px; }
.info .isub { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.info h3 { margin: 18px 0 6px; font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.info p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; }
.info ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.info li { margin-bottom: 4px; }
.info .scenes { display: flex; flex-direction: column; gap: 6px; }
.info .scenes a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.info .scenes a:hover { border-color: rgba(124,196,255,.55); background: rgba(124,196,255,.06); }
.info .scenes a span { color: var(--muted); font-size: 11.5px; margin-left: auto; font-family: var(--mono); }
.info .struct { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.info .struct b { color: var(--text); font-weight: 600; }
.info .struct .rt { color: var(--text); font-style: italic; }
.info .simp { margin-top: 18px; padding: 12px 14px; border: 1px dashed rgba(255,194,71,.45); border-radius: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.info .simp b { color: #ffc247; }
.info .simp ul { font-size: 12.5px; padding-left: 16px; margin-top: 6px; }
.info .src { font-size: 12.5px; padding-left: 16px; }
.info .src a { color: var(--accent); text-decoration: none; }
.info .src a:hover { text-decoration: underline; }
.info .plantbox { margin: 6px 0 10px; padding: 9px 12px; border-radius: 10px; background: rgba(240,107,192,.12); border: 1px solid rgba(240,107,192,.5); color: #f59ad6; font-size: 13px; font-weight: 600; }

/* smallere schermen: infokolom onder het hoofdpaneel; de rechterkant scrolt als geheel */
@media (max-width: 1320px) {
  .layout { grid-template-columns: 270px minmax(0, 1fr); grid-template-rows: max-content max-content; align-content: start; overflow-y: auto; }
  .main, .info { min-height: auto; }
  .side { position: sticky; top: 0; height: calc(100vh - 54px); grid-row: 1 / span 2; grid-column: 1; }
  .main { grid-column: 2; grid-row: 1; overflow: visible; }
  .info { grid-column: 2; grid-row: 2; border-left: 0; border-top: 1px solid var(--line); background: none; overflow: visible; columns: 2 320px; column-gap: 28px; }
  .info > * { break-inside: avoid; }
  .stage { height: clamp(340px, 60vh, 560px); }
  .slots.n2 .stage, .slots.n3 .stage { height: clamp(280px, 48vh, 440px); }
  .slots.n3 .sh .hand { display: none; }
}
