/* hexbin-app.css — layout + bar-chart styles for the production explore build.
   Everything lives under .hbapp so it can drop into one div on any page. */
.hbapp { color: #ddd; font: 14px system-ui, sans-serif; }
.hbapp * { box-sizing: border-box; }

.hbapp-top { margin: 0 0 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hbapp-top label { color: #bbb; }
.hbapp-top select, .hbapp-top input { font: 13px system-ui; padding: 2px 6px; background: #1a1a1a; color: #eee; border: 1px solid #444; border-radius: 5px; }
.hbapp-gene-go { background: #2b6cb0; color: #fff; border: 1px solid #3b82f6; border-radius: 5px; padding: 3px 12px; cursor: pointer; }

.hbapp-main { display: flex; gap: 14px; align-items: flex-start; }
.hbapp-map { flex: 1 1 0; min-width: 420px; height: 620px; border: 1px solid #333; border-radius: 8px; }
.hbapp-right { width: 460px; flex: none; display: flex; flex-direction: column; }
.hbapp-side { width: 100%; flex: none; }

/* bar charts */
.hbapp-bars { margin-top: 14px; }
.hbapp-metrics, .hbapp-aggrow { margin-bottom: 8px; color: #bbb; }
.hbapp-charts + .hbapp-metrics { margin-top: 14px; }   /* controls now sit BELOW the charts */
.hbapp-metrics button, .hbapp-aggrow button { background: #233; color: #cde; border: 1px solid #456; border-radius: 5px; padding: 2px 9px; margin-right: 4px; cursor: pointer; }
.hbapp-metrics button.on, .hbapp-aggrow button.on { background: #2b6cb0; color: #fff; border-color: #3b82f6; }
.hbapp-catparams { margin-bottom: 10px; color: #bbb; font-size: 12px; display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; max-width: 520px; }
.hbapp-catparams label { display: inline-flex; align-items: center; gap: 4px; cursor: help; }
.hbapp-catparams input { width: 58px; font: 12px system-ui; padding: 1px 4px; background: #1a1a1a; color: #eee; border: 1px solid #444; border-radius: 4px; }
.hbapp-catreset { background: #233; color: #cde; border: 1px solid #456; border-radius: 5px; padding: 2px 9px; cursor: pointer; }
.hbapp-charts { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.hbapp-chartwrap { margin: 0 auto; }
.hbapp-title { font-size: 13px; color: #bbb; margin: 6px 0; text-align: center; }
.hbapp-chart { display: flex; align-items: flex-start; justify-content: center; }
.hbapp-yaxis { width: 34px; height: 150px; position: relative; }
.hbapp-yaxis span { position: absolute; right: 6px; font-size: 10px; color: #999; transform: translateY(-50%); white-space: nowrap; }
.hbapp-plot { flex: 1; overflow-x: auto; border-left: 1px solid #444; }
.hbapp-barrow { display: flex; align-items: flex-end; gap: 5px; height: 150px; border-bottom: 1px solid #444; padding: 0 4px; }
.hbapp-bar { width: 22px; border-radius: 2px 2px 0 0; min-height: 1px; position: relative; }
.hbapp-barfill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0 0 2px 2px; }
.hbapp-tip { position: fixed; z-index: 9999; pointer-events: none; background: #1b1f24; color: #e5e7eb;
  border: 1px solid #3a4049; border-radius: 6px; padding: 6px 9px; font: 11px/1.5 system-ui;
  max-width: 280px; box-shadow: 0 6px 18px rgba(0,0,0,.55); }
.hbapp-tip .hbapp-tip-h { font-weight: 600; margin-bottom: 3px; }
.hbapp-tip span, .hbapp-tip i { display: block; white-space: nowrap; }
.hbapp-tip b { font-weight: 600; }
.hbapp-tip i.nc, .hbapp-tip .nc { color: #9aa3ad; font-style: italic; }   /* non-counted niches */
.hbapp-bar.hbapp-na { background: transparent; border: 1px dashed #667; height: 16px; display: flex; align-items: center; justify-content: center; font-size: 8px; color: #99a; }
.hbapp-lab { display: flex; gap: 5px; padding: 4px 4px 0; height: 120px; }
.hbapp-blab { width: 22px; font-size: 10px; color: #bbb; white-space: nowrap; writing-mode: vertical-rl; transform: rotate(180deg); overflow: hidden; text-overflow: ellipsis; }
/* niches excluded from the category calc (specificity_category=0): greyed out */
.hbapp-blab.hbapp-excl { color: #6b7280; font-style: italic; }
.hbapp-bar.hbapp-excl { filter: grayscale(1); }

/* category line */
.hbapp-cat { margin: 10px auto 0; font-size: 12px; color: #bbb; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; max-width: 520px; }
.hbapp-catpill { font-weight: 600; color: #fff; border-radius: 11px; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.hbapp-cattis { color: #9fb0b6; font-style: italic; }
.hbapp-cattau { color: #8a97a0; font-variant-numeric: tabular-nums; }

/* fullscreen: keep controls + bars visible, no page scrollbars */
.hbapp:fullscreen, .hbapp:-webkit-full-screen { width: 100vw; height: 100vh; overflow: hidden; display: flex; flex-direction: column; padding: 10px; background: #0d0d0d; }
.hbapp:fullscreen .hbapp-main, .hbapp:-webkit-full-screen .hbapp-main { flex: 1 1 auto; min-height: 0; align-items: stretch; }   /* stretch children to full row height */
.hbapp:fullscreen .hbapp-map, .hbapp:-webkit-full-screen .hbapp-map { height: auto; min-width: 0; align-self: stretch; }        /* map fills the row's height */
/* right column holds controls+legend+composition AND the bar chart; let it fill the
   row height and scroll if the content is taller than the screen, so the chart shows. */
.hbapp:fullscreen .hbapp-right, .hbapp:-webkit-full-screen .hbapp-right { height: 100%; overflow-y: auto; }
