/* hexbin-viewer — scoped styles. The host sets the size of the container (.hbv). */
.hbv { position: relative; width: 100%; height: 100%; min-height: 300px; background: #111; color: #eee;
  font: 13px system-ui, sans-serif; overflow: hidden; }
.hbv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

.hbv-panel { position: absolute; top: 8px; left: 8px; z-index: 10; background: rgba(0,0,0,.78);
  padding: 9px 11px; border-radius: 8px; line-height: 1.6; max-width: 440px; }
.hbv-panel .hbv-row { margin-bottom: 4px; width: 500px;}
.hbv-panel select, .hbv-panel input { font: 12px system-ui; }
.hbv-mode, .hbv-scale { background: #233; color: #cde; border: 1px solid #456; border-radius: 5px; padding: 2px 9px; cursor: pointer; font: 12px system-ui; }
.hbv-mode.on, .hbv-scale.on { background: #2b6cb0; color: #fff; border-color: #3b82f6; }
.hbv-reset, .hbv-fs { background: #233; color: #cde; border: 1px solid #456; border-radius: 5px; padding: 2px 8px; cursor: pointer; font: 12px system-ui; }
/* map tools (PNG + full-screen icon), top-right, equal height */
.hbv-maptools { position: absolute; top: 8px; right: 8px; z-index: 12; display: flex; gap: 6px; align-items: center; }
/* styled PNG download button — height matches the full-screen icon (30px) */
.hbv-png { display: inline-flex; align-items: center; gap: 5px; height: 30px; box-sizing: border-box;
  background: #2b6cb0; color: #fff; border: 1px solid #3b82f6; border-radius: 6px; padding: 0 12px;
  cursor: pointer; font: 600 12px system-ui; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.hbv-png:hover { background: #3b82f6; }
.hbv-png:active { transform: translateY(1px); }
.hbv-fsicon { width: 30px; height: 30px; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); color: #e8f0ff; border: 1px solid #456; border-radius: 6px; cursor: pointer;
  font-size: 17px; line-height: 1; padding: 0; }
.hbv-fsicon:hover { background: rgba(43,108,176,.9); border-color: #3b82f6; }
/* expression colour legend overlaid on the map (top-left), expression mode only */
.hbv-exprlegend { position: absolute; top: 8px; left: 8px; z-index: 11; background: rgba(0,0,0,.78);
  padding: 6px 9px; border-radius: 8px; max-width: 300px; font: 12px system-ui; color: #eee; line-height: 1.5; }
.hbv:fullscreen { width: 100vw; height: 100vh; }
.hbv:-webkit-full-screen { width: 100vw; height: 100vh; }

.hbv-legend { margin-top: 6px; font-size: 12px; }
/* nicer custom checkbox (Show grey bg), aligned with its label */
.hbv-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.hbv-check input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0;
  flex: none; border: 1px solid #567; border-radius: 4px; background: #1a2430; cursor: pointer; position: relative; }
.hbv-check input[type=checkbox]:hover { border-color: #3b82f6; }
.hbv-check input[type=checkbox]:checked { background: #2b6cb0; border-color: #3b82f6; }
.hbv-check input[type=checkbox]:checked::after { content: ""; position: absolute; left: 5px; top: 2px;
  width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* niche composition centered as a block */
.hbv-comp { text-align: center; }
.hbv-comp .hbv-compbar, .hbv-comp .hbv-compscale { margin-left: auto; margin-right: auto; }
/* when rendered into a host element beside the map (controlsTarget) */
.hbv-panel-static { position: static; background: transparent; max-width: none; padding: 0; }
/* narrow docked panel: wrap each row so nothing overflows the sidebar width */
.hbv-panel-static .hbv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 8px; width: auto; }
/* docked panel has room, so don't clip the niche list like the on-map overlay does */
.hbv-panel-static .hbv-swrow { max-height: none; overflow: visible; }
.hbv-cbar { height: 12px; width: 180px; border: 1px solid #444; border-radius: 2px; }
.hbv-cbarlab { display: flex; justify-content: space-between; width: 180px; color: #bbb; }
.hbv-swrow { display: flex; flex-wrap: wrap; gap: 5px 12px; max-height: 150px; overflow: auto; margin-top: 3px; }
.hbv-sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.hbv-toggle { cursor: pointer; user-select: none; }
.hbv-toggle:hover { text-decoration: underline; }
.hbv-toggle.off { opacity: .4; text-decoration: line-through; }
.hbv-dim { color: #888; }
.hbv-compbar { display: flex; width: 100%; max-width: 320px; height: 16px; margin-top: 3px; border: 1px solid #444; border-radius: 3px; overflow: hidden; }
.hbv-compseg { height: 100%; min-width: 1px; }
.hbv-compscale { display: flex; justify-content: space-between; width: 100%; max-width: 320px; font-size: 9px; color: #888; margin-top: 1px; }
.hbv-tip { position: absolute; z-index: 20; pointer-events: none; background: rgba(0,0,0,.85);
  border: 1px solid #456; border-radius: 5px; padding: 4px 7px; font-size: 12px; color: #eee; white-space: nowrap; line-height: 1.4; }

.hbv-thumbs { position: absolute; left: 8px; bottom: 8px; z-index: 10; display: flex; gap: 8px;
  background: rgba(0,0,0,.7); padding: 8px; border-radius: 8px; max-width: calc(100% - 16px); overflow-x: auto; }
.hbv-thumbs figure { margin: 0; text-align: center; cursor: pointer; }
.hbv-thumbs img { height: 42px; width: auto; border: 2px solid transparent; border-radius: 4px; background: #222; display: block; }
.hbv-thumbs figure.on img { border-color: #3b82f6; }
.hbv-thumbs figcaption { display: none; }   /* sample name not shown on the thumb; it's in the chart header */
