/*───────────────────────────────────────────────────────────────
  PELAGICA  ‣  ONE-PAGE STYLE SHEET
────────────────────────────────────────────────────────────────*/

/* ==========  0. DESIGN TOKENS  ================================= */
:root{
  --glass-bg : rgba(98, 112, 156,0.4);
  --glass-brd: 1px solid rgba(255,255,255,.18);
  --text-light: #fff;
  --text-dark : #000;
  --grad-1: #bfe4ff;
  --grad-2: #7ab3ff;
  --grad-3: #316fd1;
  --grad-4: #0b2d75;
  --grad-5: #000c28;
  --scroll-thumb: rgba(255,255,255,.25);
  --blur-sm : blur(4px);
  --blur-md : blur(6px);
}

.glass-panel {
  background: linear-gradient(
    to bottom,
    rgba(50, 70, 110, 0.32), /* same hue, less opacity */
    rgba(30, 45, 75, 0.38)   /* slightly lighter + less opacity */
  );
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  
  border-radius: 0.5rem;
  color: #fff;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px #0006;
  padding: 0.5rem;
}





/* ==========  1. GLOBAL ELEMENTS  ============================== */
html,body{ height:100%; overflow-x:hidden; }

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text-light);
  background-size: cover; /* makes the image fill the screen */
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed; /* keeps it stationary while scrolling */
}

body::before {
  content: "";
  position: fixed; /* or absolute if not using background-attachment: fixed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0, 0.3); /* adjust color + transparency */
  z-index: -1; /* sits under foreground content, over the image */
  pointer-events: none; /* allows clicks to pass through */
}


/* Dash container max-width */
.container-fluid{ max-width:1600px; }

h6,
.h6 {                     
  color: #fff !important;  
}

h5,
.h5 {                     
  color: #fff !important;  
}

/* ==========  2. TOP BAR & LOGO  =============================== */
#top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0rem;
  
  padding: 0.3rem 1rem;
  height: 4rem;       

  /* a hint of color for airiness */
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);

  border-bottom-left-radius: 0.0rem;
  border-bottom-right-radius: 0.0rem;
  z-index: 1050;
}

/* shrink the logo slightly to fit the bar */
#logo {
  font-size: 1.8rem;
  line-height: 2rem;    /* vertically center it in the 3rem bar */
}



/* Hide tagline on screens smaller than 600px (adjust as needed) */
@media (max-width: 768px) {
  .tagline {
    display: none;
  }
}
/* ==========  3. SEARCH PANEL (top-left)  ===================== */

#search-panel {
  position: fixed;
  top: 10%;
  left: 20px;
  z-index: 1040;
  width: 450px;
  padding: 0.8rem 0.9rem 1rem;
  border-radius: 0.6rem 0 0.6rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Hidden unless explicitly open */
#search-panel:not(.open) {
  display: none;
}

/* Arrow position adjustment */
#prev-btn {
  left: calc(20px + 320px + 24px);
}

/* Dropdown overrides */
#search-panel .dash-dropdown,
#search-panel .dash-select,
#search-panel .Select-menu,
#search-panel .Select-option,
#search-panel .Select-placeholder,
#search-panel .Select-value-label {
  background: white !important;
  color: black !important;
}

#search-panel .Select-control:hover {
  border-color: #888 !important;
}

#search-stack > div {
  margin-bottom: 10px;
}

/* COLLAPSE ICON ROTATION (when search panel is hidden inline-style) */
#search-panel[style*="display: none"] .collapse-icon {
  transform: rotate(-90deg);   /* points right */
}

/* ─── Search Handle ─────────────────────────────── */
.search-handle {
  position: fixed;
  top: 126px;
  left: calc(-11px + 450px);
  width: 100px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius:  0rem 0rem 0.4rem 0.4rem;
  background:var(--glass-bg); border:var(--glass-brd);
  backdrop-filter:var(--blur-md); 
  pointer-events: auto;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 1041;
  transition: left 0.1s ease;
  line-height: 1.1;
  padding: 0.3rem 0;
  transform: rotate(-90deg);
}

.search-handle.collapsed {
  left: -32px;
}

.search-handle:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* When panel is open, push handle to edge */
body.search-open .search-handle {
  left: 320px;
}

/* ─── Mobile Styles ─────────────────────────────── */
@media (max-width: 768px) {
  #search-panel {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding: 1.5rem 1rem;
    border-radius: 0;
    background-color: rgba(0, 20, 40, 0.96);
    backdrop-filter: blur(8px);
    gap: 1rem;
    box-shadow: none;
    display: none;
    z-index: 2000;
  }

  #search-panel.open {
    display: flex;
    flex-direction: column;
  }

  body.search-open #search-handle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: auto;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    font-size: 1.5rem;
    background: white;
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    line-height: 1;
    z-index: 2100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    transition: all 0.1s ease;
  }

  body.search-open #search-handle::before {
    content: "×";
    position: absolute;
    font-size: 1.5rem;
  }

  body.search-open #search-handle > * {
    visibility: hidden;
  }
}

.search-handle{
    top: calc(4rem + 64px);     /* 4 rem bar + a little breathing room */
}

/* Mobile-only close button INSIDE the search panel */
#mobile-close-btn {
  display: none; /* hidden by default */
}

@media (max-width: 768px) {
  #mobile-close-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    width: 2.2rem;
    height: 2.2rem;
    background: white;
    color: black;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 9999;
  }

  #search-panel:not(.open) #mobile-close-btn {
    display: none; /* don’t show if panel isn’t open */
  }
}


#search-panel{
    top: 104px !important;            
  }

.search-handle{
    top: 134px !important;           
  }
  
@media (max-width: 769px) {
  #search-panel {
    top: 0px !important;
  }}
  
/* ↓ also shrink the items inside the opened menu */
.Select-menu-outer .Select-option,
.Select-menu-outer .VirtualizedSelectOption {   /* Dash >2.9 uses this class */
    font-size: 0.85rem !important;
}

/* Default (Settings collapsed): allow menus to extend past the panel */
#search-panel {
  overflow: visible;              /* dropdowns can overflow like before */
}

/* When Settings is OPEN: cap height and scroll the entire panel */
#search-panel:has(#adv-box:not([style*="display: none"])) {
  max-height: 90vh;               /* adjust if you prefer 100vh */
  overflow-y: auto;
}

/* (Optional) keep long menus reasonable & above glass panels */
#search-panel .Select-menu-outer {
  max-height: 16rem;              /* internal scroll if very long */
  overflow-y: auto;
  z-index: 4000;
}




/* ==========  4. SIDE TABS  ==================================== */
/* side-tabs in gutter */
/* ==========  4. SIDE TABS  ==================================== */
.side-tab {
  position: fixed;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background:var(--glass-bg); border:var(--glass-brd);
  backdrop-filter:var(--blur-md); 
  border-radius: 0rem 0.4rem 0.4rem 0rem;
  color: #fff;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  padding: .55rem .45rem;
  font-size: .85rem;
  cursor: pointer;
  z-index: 5;
  transition: left .3s ease, right .3s ease;
}



#citations-tab {
  right: 0;
  top: 65vh;           /* anchor the first tab */
  z-index: 4
}

#bug-tab {
  right: 0;
  top: calc(65vh + 105px);  /* same anchor + constant gap */
  z-index: 4
}




/* ==========  5. OFF-CANVAS PANELS  ============================ */
.offcanvas{
  /*background:var(--glass-bg)!important;
  color:var(--text-light)!important;
  border-left:var(--glass-brd);
  box-shadow: 0 2px 6px #0006;*/
}
.offcanvas-title,
.offcanvas-body{ color:var(--text-light)!important; }
.offcanvas-header, .offcanvas-body {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding-left: 1.0rem !important;   /* ≈ 13 px */
  padding-right: 1.0rem !important;  /* ≈ 13 px */
  box-sizing: border-box;            /* ensures width stays fixed */
}



.offcanvas-header {
  padding-top: 12rem !important;
  display: flex;
  flex-direction: row; /* instead of column */
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding-left: 1rem;
  padding-right: 1rem;
}


.offcanvas-title {
  font-size: 1.2rem;
  font-weight: 600;
  flex: 1;                
  text-align: center;     
}




/* citation text wraps */
#citation-box{
  white-space:pre-wrap; word-wrap:break-word;
  color:var(--text-light); font-size:.9rem;
}

#citation-box a{ color:var(--text-light); }

/* Rounded switch styling */
.form-switch .form-check-input {
  width: 3rem;
  height: 1.5rem;
  border-radius: 1rem;
  background-color: #ccc;
  border: none;
  vertical-align: middle;
  margin-top: 0.2rem; /* tweak if necessary */
  transition: background-color 0.3s, box-shadow 0.3s;
  margin-left: auto;        /* takes up remaining space */
}



/* Optional: make it more visible when unchecked too */
.form-switch .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}





.form-switch.form-check {
  padding: 0 0.5rem;        /* 0.5 rem left & right */
  padding-left: 0;            /* <<< THE FIX */
  display: flex;              /* keep them side-by-side */
  align-items: center;        /* vertically centred */
  justify-content: space-between;  /* pill stays flush right */
  margin-bottom: 0.9rem;   /* tweak the 0.6rem until it feels right */
}





.form-switch .form-check-input:checked {
  background-color: #4CAF50; /* soft green */
  box-shadow: inset 0 0 0 1px #4CAF50;
}

.form-switch .form-check-label {
  display: inline-block;
  vertical-align: middle;
  line-height: 1.5rem;
  flex: 1;        /* let text wrap but don’t push pill off-screen */
  margin-bottom: 0;
  line-height: 1.5rem;
  margin-left: 0.5rem;
}




/* ==========  6. MAIN DISPLAY AREA  ============================ */
#page-centre-flex{
  min-height:calc(100vh - 150px);     /* header+footer buffer */
  display:flex; flex-direction:column;
  justify-content:center; align-items:center;
  text-align:center;
  margin-top: 110px;
}

/* 6-a  title slab */
#species-titles{
  display:inline-block; margin:.5rem 0 1rem;
  padding:.6rem 1.4rem .8rem;
  background:var(--glass-bg); border:var(--glass-brd);
  backdrop-filter:var(--blur-md); box-shadow:0 2px 6px #0008;
  border-radius:2rem;
}


#species-titles h1,
#species-titles h4{ margin:0; color:var(--text-light); }
#species-titles h1{ font-size:1.5rem; }
#species-titles h4{ font-weight:400; font-style:italic; }



#image-inner {
  position: relative !important;
  width: 100%;
  height: auto;
}




#image-wrapper{
  position: relative !important;
  width: clamp(320px, 52vw, 520px);   /* overall image width */
  margin: 0 auto;

  /* vertical fade (top & bottom) 
  -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      black 12%,
      black 88%,
      transparent 100%);
          mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      black 12%,
      black 88%,
      transparent 100%);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;*/
}



@keyframes subtle-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

#species-img {
  max-height: 70vh;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  animation: subtle-bounce 2.5s ease-in-out infinite;
}

#species-img{ position: relative;  z-index: 1 !important;
}

#sizecmp-img {
  z-index: 2 !important;
}





/* Info card anchored *overlapping* below the image */
#info-card {
  /*background: var(--glass-bg);
  border: var(--glass-brd);
  backdrop-filter: var(--blur-md);
  color: var(--text-light);*/
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  /*box-shadow: 0 2px 6px #0008;*/
  border-radius: 0.8rem;
  overflow-y: auto;
  z-index: 3;
  position: absolute;
  top: calc(100% + 0.0rem);    /* small gap under image */
  left: 0;
  width: 100%;
  max-width: 100%;             /* exactly as wide as image-wrapper */
  scrollbar-color: var(--scroll-thumb) transparent;
}

#info-card{
    overscroll-behavior: contain;   /* stops wheel‑scroll bubbling */
}

/* Handle remains bottom-left of image */
#info-handle {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--glass-bg);
  border: var(--glass-brd);
  border-radius: 50%;
  color: var(--text-light);
  cursor: pointer;
  font-weight: 600;
  backdrop-filter: var(--blur-md);
  box-shadow: 0 2px 6px #0008;
  display: none;  /* toggle via JS/callback */
  z-index:2;
  pointer-events:auto;
}

#fav-handle{
  position:absolute; left:3.2rem; bottom:.6rem;
  width:2rem;height:2rem;display:grid;place-items:center;
  font-size:1.4rem;font-weight:700;cursor:pointer;
  background:var(--glass-bg);border:var(--glass-brd);
  border-radius: 50%;
  color: var(--text-light);
  border-radius:50%;backdrop-filter:var(--blur-md);
  box-shadow:0 2px 6px #0008;color:var(--text-light);
  z-index:2;pointer-events:auto;
}

.filled   { color:#ff6688; }   /* heart filled */
#fav-handle.filled,            /* outline → solid AND pink */
.top-heart.filled      { color:#ff6688; }

.heart-icon {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}



.heart-icon:hover {
    color: #e00;
}


.scale-icon {
  position: absolute;
  bottom: 10px;
  left: 95px;  /* Adjust as needed */
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 2;

  /* match other icons visually */
  background: var(--glass-bg);
  border: var(--glass-brd);
  border-radius: 50%;
  color: var(--text-light);
  backdrop-filter: var(--blur-md);
  box-shadow: 0 2px 6px #0008;
  pointer-events: auto;
  transition: opacity 0.2s ease;
  opacity: 0.8;
}

.scale-icon.active {
  opacity: 1.0;
  color: #40c4ff;  /* blue tint when active (optional) */
}

.tree-icon{

  position: absolute;
  bottom: 10px;
  left: 138px;  
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 2;

  /* match other icons visually */
  background: var(--glass-bg);
  border: var(--glass-brd);
  border-radius: 50%;
  color: var(--text-light);
  backdrop-filter: var(--blur-md);
  box-shadow: 0 2px 6px #0008;
  pointer-events: auto;
  transition: opacity 0.2s ease;
  opacity: 0.8;
}


.sound-icon {
  position: absolute;
  bottom: 10px;
  left: 180px;  /* Adjust as needed */
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 2;

  /* match other icons visually */
  background: var(--glass-bg);
  border: var(--glass-brd);
  border-radius: 50%;
  color: var(--text-light);
  backdrop-filter: var(--blur-md);
  box-shadow: 0 2px 6px #0008;
  pointer-events: auto;
  transition: opacity 0.2s ease;
  opacity: 0.8;
}


/* custom.css */
.form-check-input:checked {
    background-color:#8c8c8c;
    border-color:#8c8c8c;
}
.form-check-input {
    cursor:pointer;
}



/* Make close button more button-like */
#info-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: var(--text-light);
  cursor: pointer;
  z-index: 2;
  font-weight: bold;
  font-size: 1.2rem;
  border: 1px solid #ffffff44;
}


#info-close:hover {
  background: rgba(255, 255, 255, 0.2);
}


#info-card a {
  color: var(--text-light);
}

#info-card::-webkit-scrollbar {
  width: 6px;
}
#info-card::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 3px;
}



/* Unified icon rail (bottom-left of #image-wrapper) */
:root{
  --icon-pad: 0.6rem;    /* distance from left/bottom edge */
  --icon-size: 2rem;     /* ⌀ of each round button */
  --icon-gap: 0.65rem;   /* space between buttons */
}

/* normalize all buttons’ positioning & dimensions */
#image-wrapper { position: relative; } /* already set earlier; keep it */

#info-handle, #fav-handle, .scale-icon, .tree-icon, .sound-icon {
  position: absolute;
  bottom: var(--icon-pad);
  left: calc(var(--icon-pad) + (var(--icon-order, 0)) * (var(--icon-size) + var(--icon-gap)));
  width: var(--icon-size);
  height: var(--icon-size);
  display: grid; place-items: center;
  /* keep your existing visuals (glass, blur, shadows, etc.) */
}

/* assign the horizontal order (0,1,2,3,…) */
#info-handle { --icon-order: 0; }
#fav-handle  { --icon-order: 1; }
.scale-icon  { --icon-order: 2; }
.tree-icon   { --icon-order: 3; }
.sound-icon  { --icon-order: 4; }

/* === Icon rail (compacts automatically when some buttons are hidden) === */
#icon-rail{
  position:absolute;
  left: var(--icon-pad);
  bottom: var(--icon-pad);
  display:flex;
  gap: var(--icon-gap);
  z-index: 4;                 /* above image, under panels */
}

/* Normalize buttons when inside the rail (no absolute coords here) */
#icon-rail > .icon-btn,
#icon-rail #info-handle,
#icon-rail #fav-handle,
#icon-rail .scale-icon,
#icon-rail .tree-icon,
#icon-rail .sound-icon,
#icon-rail .chat-icon{
  position: static !important;
  left:auto !important;
  bottom:auto !important;

  width: var(--icon-size);
  height: var(--icon-size);
  display: grid;
  place-items: center;
  background: var(--glass-bg);
  border: var(--glass-brd);
  border-radius: 50%;
  color: var(--text-light);
  backdrop-filter: var(--blur-md);
  box-shadow: 0 2px 6px #0008;
  cursor: pointer;
  pointer-events: auto;
}

/* Chat button look (same size as others) */
.chat-icon { font-size: 1.1rem; }

/* Chat panel matches info panel geometry so they never overlap visually */
#chat-card{
  padding: 1rem 1.2rem;
  font-size: .9rem;
  border-radius: .8rem;
  overflow-y: auto;
  z-index: 3;
  position: absolute;
  top: calc(100% + 0rem);
  left: 0;
  width: 100%;
  max-width: 100%;
  display: none;              /* toggled by Dash */
}
#chat-close{
  position:absolute; top:.6rem; right:.6rem;
  width:1.6rem; height:1.6rem; display:grid; place-items:center;
  background: rgba(255,255,255,.15);
  border-radius:50%; color:#fff; font-weight:700; cursor:pointer;
  border: 1px solid #ffffff44;
}


/* Optional: slightly tighter on phones */
@media (max-width: 768px){
  :root{ --icon-size: 1.7rem;}
}







/* ==========  7. FOOTER CREDIT  ================================ */
#footer-credit{
  position:fixed; right:1rem; bottom:1rem;
  font-size:.8rem; opacity:.7;
}


/* === NAVIGATION ARROWS =================================== */
 /*.edge-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1030;
  background: none;
  border: none;
  font-size: 3rem;
  color: #ffffffbb;      
  cursor: pointer;
  padding: 0 0.5rem;
  transition: color 0.3s ease, transform 0.3s ease;*/
}

 /* .edge-nav:hover {
  color: #ffffffee;       
  transform: translateY(-50%) scale(1.1);
} */

#prev-btn {
  left: 10rem;
}

#next-btn {
  right: 10rem;
}

/* Optional: fine-tune font appearance 
.edge-nav .label {
  font-size: 1rem;
  display: block;
  text-align: center;
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
  opacity: 0.6;
}*/

.collapse-icon{
  cursor: pointer;
  transition: transform .2s;
}



.btn-outline-light {
  color: white;
  border: 1px solid white;
  background-color: transparent;
  font-weight: 400;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
}

/* On hover: lighter border or subtle glow */
.btn-outline-light:hover {
  color: white;
  border-color: #ccc;
  background-color: rgba(255, 255, 255, 0.1); /* optional glow */
}

#adv-box .gx-1 > .col > .btn {
    white-space: nowrap;          /* keep labels on one line */
}


/* vertical nav inherits ALL styling from .edge-nav 
.vert-nav{
  z-index: 1030;
  background: none;
  border: none;
  font-size: 3rem;
  color: #ffffffbb;      
  cursor: pointer;
  padding: 0 0.5rem;
  transition: color 0.3s ease, transform 0.3s ease;
  
  position: fixed;
  display: flex;                 
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;                   
}

.vert-nav .chev{
  transform: rotate(90deg);
  display: block;
  line-height: 1;                
}

helper text size matches the sideways labels 
.vert-nav .label{
  font-size: 1rem;
  margin-top: 0.25rem;
  opacity: 0.6;
}*/



/* shared look is already in .vert-nav – here we just position
#up-btn{
  position: absolute;
  top: -12.0rem;             
  left: 50%;
  transform: translateX(-50%);   
  bottom: calc(-1 * var(--depth-arrow-offset));
}
#down-btn{
  position: absolute;
  bottom: -8.0rem;           
  left: 50%;
  transform: translateX(-50%);
  top:    calc(-1 * var(--depth-arrow-offset));
}*/







.settings-header {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
}

.settings-group {
  margin-bottom: 1.2rem;
  padding-left: 0.3rem;
}

.settings-note {
  margin-top: 0.1rem;
  padding-left: 4rem;
  font-size: 0.8em;
  line-height: 1.4;
  opacity: 0.7;
  max-width: 380px;
}




/* ─── PANEL ─────────────────────────────────────────────────────── */
#nav-panel {
  position: fixed;
  top: 6.5rem;
  right: 3.5rem;
  width: 210px;
  height: 210px;
  padding: 0.5rem;
  /*background: rgba(0,0,0,0.2);
  border-radius: 0.5rem;
  color: #fff;*/
  z-index: 1030;
  pointer-events: none;
}

/* ─── HEADER ───────────────────────────────────────────────────── */
.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  pointer-events: auto;
}
.nav-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-info-icon {
  cursor: pointer;
  opacity: 0.7;
  pointer-events: auto;
  font-size: 1.5rem;
}

/* ─── DIAL BACKGROUND ──────────────────────────────────────────── */
.dial-bg {
  position: absolute;
  top: 2.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  user-select: none;
  pointer-events: none;
}

/* ─── BUTTONS (ARROWS) ─────────────────────────────────────────── */

/* UP BUTTON */
#up-btn {
  position: absolute;
  top: 0%;       /* relative to panel height */
  left: 50%;
  transform: translateX(-50%) rotate(90deg) scaleX(-1);
}

/* DOWN BUTTON */
#down-btn {
  position: absolute;
  bottom: 0%;
  left: 50%;
  transform: translateX(-50%) rotate(90deg);
}

/* LEFT BUTTON */
#prev-btn {
  position: absolute;
  top: 50%;
  left: 4%;
  transform: translateY(-50%) scaleX(-1);
}

/* RIGHT BUTTON */
#next-btn {
  position: absolute;
  top: 50%;
  right: 4%;
  transform: translateY(-50%) rotate(0deg);
}

/* ─── LABELS ───────────────────────────────────────────────────── */

/* UP LABEL */
#nav-label-up {
  position: absolute;
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
}

/* DOWN LABEL */
#nav-label-down {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
}

/* LEFT LABEL */
#nav-label-left {
  position: absolute;
  top: 50%;
  left: -6%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
}

/* RIGHT LABEL */
#nav-label-right {
  position: absolute;
  top: 50%;
  right: -5%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
}

/* ─── ICON AND LABEL BASE STYLES ───────────────────────────────── */
.nav-icon {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #fff;
  pointer-events: auto;
}

.nav-label {
  font-size: 0.75rem;
  opacity: 0.8;
  line-height: 1;
  white-space: nowrap;
  pointer-events: auto;
}

/* ─── INFO TEXT ───────────────────────────────────────────────── */
#nav-info-text {
  position: fixed;
  top: 2rem;
  right: 0rem;
  width: 210px;
  height: 210px;

  /* Match main panel style */
  width: 210px;
  height: 210px;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.99);
  color: #fff;
  border-radius: 0.5rem;
  opacity: 1;  /* match nav-panel’s visual presence */

  /* Text styling */
  font-size: 0.75rem;
  line-height: 1.2;

  pointer-events: auto;
  display: none;  /* toggled by interaction */
  
  z-index:10;
}




/*───────────────────────────────────────────────────────────────
  UNITS TOGGLE  & FAV MENU
────────────────────────────────────────────────────────────────*/
.units-switch .form-check-input{
  width: 34px;                 /* slim pill */
  top: 8px;
  height: 14px;
  border-radius: 14px;
  background: #9a9a9a;         /* mid‑grey both states */
  border: none;
  box-shadow: none;
  margin: 0;                   /* removes bootstrap offset */
  vertical-align: middle;
  position: relative;
  cursor: pointer;
}
/* little white knob */
.units-switch .form-check-input::after{
  content:"";
  position:absolute;
  top: 1px; left: 1px;         /* start far left */
  width: 12px; height: 12px;
  background:#fff;
  border-radius:50%;
  transition:left .18s ease;
}
/* when checked, slide knob to the right */
.units-switch .form-check-input:checked::after{
  left: 21px;
}
/* keep background the same when checked (no green!) */
.units-switch .form-check-input:checked{
  background:#9a9a9a;
}

/* hide the word “Favourites” on narrow screens */
@media (max-width: 768px){          /* tweak breakpoint as you like */
  .fav-label { display:none; }
}

/* always‑narrow favourites modal */
.fav-modal .modal-dialog{
  max-width: 320px;      /* desktop & tablet */
  width:100%;
}

@media (max-width: 768px){
  .fav-modal .modal-dialog{
    max-width: 260px;    /* phones */
  }
}


.fav-modal .modal-dialog{
    max-width: 320px;          /
    margin: 1.25rem auto;      /* auto keeps it centred */
}
@media (max-width: 576px){     /* very small screens */
    .fav-modal .modal-dialog{
        width: 90vw;           /* stretchy but still centred */
        max-width: 90vw;
    }
}

.fav-modal .modal-dialog{
  width: 320px;
  max-width: 320px;
  margin: 1.25rem auto;        /* auto keeps it centred */
}
@media (max-width: 360px){     /* very narrow phones */
  .fav-modal .modal-dialog{
    width: 92vw;               /* still centred, fills most of screen */
    max-width: 92vw;
  }
}


.fav-modal .modal-content {
  background: var(--glass-bg);
  backdrop-filter: var(--blur-md);
  border: var(--glass-brd);
  box-shadow: 0 2px 6px #0006;
  color: var(--text-light);
  border-radius: 0.6rem;
  overflow: hidden;
}

.fav-modal .modal-header,
.fav-modal .modal-body {
  background: transparent;
  color: var(--text-light);
  padding: 1rem;
  border: none;
  text-align: center;
}

.fav-modal .modal-header {
  font-size: 1.2rem;
  font-weight: 600;
}

.fav-modal .btn {
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
}



/* optional: if you prefer a CSS var instead of inline style */
:root { --frameScale: 1; }

/* Fullscreen, sits under the UI, we’ll scale it in JS */
/* Fullscreen baseline; JS can override later */
#depth-iframe{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  border: none;
  z-index: 0;
  pointer-events: none; /* UI remains clickable above */
  transform-origin: 50% 0;               /* top-center anchor */
  transform: scale(var(--frameScale, 1)); /* desktop = 1 */
}




/* keep Bootstrap container from adding gutters over the viewer */
.container-fluid { max-width: 100% !important; }


.rand-icon {
  opacity: 0.3;
  transition: opacity 0.2s ease-in-out;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

.rand-icon:hover {
  opacity: 1;
}

.rand-icon:active {
  transform: scale(0.95);
}

#tree-panel {overflow-x: visible !important;   
    overflow-y: auto !important;}

#tree-panel #tree-graph{
  display: block;
  margin: 0 auto;
}

.nav-icon:hover{
  opacity: .9;        
}

.lock-icon{
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
/* custom.css – place this AFTER the existing lock-icon rules */
.lock-icon       {opacity:.25;transition:opacity .15s;}
.lock-icon.active{opacity:.9 !important;}
.lock-icon:hover {opacity:.9; !important;}

.order-lock-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.4em 0.3em;
    border-radius: 7px;
    font-size: 0.5rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 9;
    display: none;
}
.order-lock-label:not(.active)::before { content: ""; }
.order-lock-label.active {
    display: block;
}

@media (hover: none), (pointer: coarse) {
  .tooltip,
  .bs-tooltip-auto,
  .popover {
    display: none !important;
  }
  
/* Mobile: make the image wrapper a bit narrower + left-align the column */
@media (max-width: 768px) {

  /* stop centering the middle column so there's extra room on the right */
  #page-centre-flex{
    align-items: flex-start;
    margin-left: 1rem; /* tiny gutter so it doesn't hug the edge */
  }

  /* narrower wrapper so the side tabs don't overlap visually */
  #image-wrapper {
    width: clamp(260px, 82vw, 480px); /* was nearly full width—now a bit slimmer */
    margin: 0;                        /* left-aligned on mobile */
  }

  /* height scales naturally; width can shrink to preserve aspect ratio */
  #species-img {
    max-height: 58vh;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
}

/* Phones & emulators 
@media (hover: none) and (pointer: coarse), (max-width: 1000px) {
  #image-wrapper {
    margin-top: clamp(1rem, 6vh, 2rem) !important;
  }
}*/


/* Slider container: sits under the button */
#sound-wrap:hover #sound-vol-wrap,
#sound-vol-wrap:focus-within {
  display: block !important;
}

#sound-vol-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 1.6rem;             /* just under the button */
  width: 140px;            /* tweak as you like */
  padding: .4rem .6rem;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  z-index: 10;
}

/* Minimal horizontal track + round thumb */
#sound-vol .rc-slider-rail   { height: 3px; }
#sound-vol .rc-slider-track  { height: 3px; }
#sound-vol .rc-slider-handle {
  width: 12px; height: 12px; margin-top: -4.5px; border: 0;
  box-shadow: 0 0 0 4px rgba(255,255,255,.25);
}

/* Positioning */
#sound-wrap {
  position: relative;
  display: inline-block;
}

#depth-sound-btn {
  line-height: 1;
  user-select: none;
}

/* The popover panel */
#vol-pop {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  top: 100%;
  width: 160px;
  padding: 8px 10px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  z-index: 9999;

  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

/* Show on hover OR when the slider has focus */
#sound-wrap:hover #vol-pop,
#vol-pop:focus-within {
  opacity: 1;
  pointer-events: auto;
}

/* Minimal horizontal track + round thumb for native range */
#vol-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;   /* provides enough room for the thumb to drag */
  background: transparent;
  margin: 0;
}

/* Track */
#vol-range::-webkit-slider-runnable-track {
  height: 3px;
  background: rgba(255,255,255,.35);
  border-radius: 2px;
}
#vol-range::-moz-range-track {
  height: 3px;
  background: rgba(255,255,255,.35);
  border-radius: 2px;
}

/* Thumb */
#vol-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  margin-top: -4.5px; /* center thumb on 3px track */
  box-shadow: 0 0 0 4px rgba(255,255,255,.25);
}
#vol-range::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.25);
  border: none;
}

/* Optional: hover affordance on the button */
#depth-sound-btn:hover { opacity: 1; }


/* in assets/tree.css */
#tree-plot .hoverlayer text {
    cursor: pointer;      /* makes hover text show link cursor */
    fill: #1a0dab !important; /* Google blue link color */
    text-decoration: underline;
}

.nav-icon.greyed {
  filter: grayscale(100%);
  opacity: 0.55;
}


/* Grey out nav arrows when disabled */
#up-btn:disabled,
#down-btn:disabled,
#prev-btn:disabled,
#next-btn:disabled,
.nav-icon[disabled] {
  opacity: 0.35 !important;
  filter: grayscale(100%);
  cursor: default;
  pointer-events: none !important; /* override .nav-icon { pointer-events:auto } */
}

/* Arrow buttons: force visible disabled state (must be last) */
#up-btn[disabled],
#down-btn[disabled],
#prev-btn[disabled],
#next-btn[disabled],
.nav-icon[disabled],
.nav-icon:disabled {
  opacity: .45 !important;
  filter: grayscale(100%) saturate(.6) !important;
  cursor: not-allowed !important;
  pointer-events: none; /* optional: removes hover affordance */
}

/* Kill hover visuals when disabled */
#up-btn[disabled]:hover,
#down-btn[disabled]:hover,
#prev-btn[disabled]:hover,
#next-btn[disabled]:hover,
.nav-icon[disabled]:hover {
  opacity: .45 !important;
  transform: none !important;
}

/* Grey the text labels when their button is disabled */
#up-btn[disabled]    ~ #nav-label-up,
#down-btn[disabled]  ~ #nav-label-down,
#prev-btn[disabled]  ~ #nav-label-left,
#next-btn[disabled]  ~ #nav-label-right {
  opacity: .45 !important;
}


/* Phone-only: stop vertical centering and push the column down a bit */
@media (hover: none) and (pointer: coarse) and (max-width: 760px) {
  #page-centre-flex{
    justify-content: flex-start !important; /* was center */
    padding-top: 28vh !important;          /* tune: 10–16vh */
    /* keep or drop the desktop margin — if it feels too low, set this to 0 */
    /* margin-top: 0 !important; */
  }

  /* Optional: tiny extra nudge for just the image block */
  #image-wrapper{
    margin-top: 10vh !important;
  }
}


/* Mobile: pull the scene back by scaling the OUTER iframe */
:root { --frameScale: 0.65; }  /* KNOB: smaller = more zoom-out */

@media (hover: none) and (pointer: coarse) and (max-width: 760px) {
  #depth-iframe {
    position: fixed;
    top: 0;
    left: 50%;
    /* make the iframe bigger by 1/scale so the scaled result still fills screen */
    width:  calc(100vw  / var(--frameScale)) !important;
    height: calc(100dvh / var(--frameScale)) !important;

    transform-origin: 50% 0 !important;      /* top-center anchor */
    transform: translateX(-50%) scale(var(--frameScale)) !important;

    /* keep whatever else you already set: border:none; z-index:0; pointer-events:none; etc. */
  }
}


/* Mobile: make the search panel truly full-screen, regardless of toolbars */
@media (max-width: 768px) {
  #search-panel {
    position: fixed !important;
    inset: 0 !important;        /* top:0; right:0; bottom:0; left:0 */
    width: auto !important;     /* let inset define the size */
    height: auto !important;
    max-height: none !important;
    overflow-y: auto;           /* scroll inside the panel */
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    box-shadow: none;
    padding: 1.5rem 1rem;       /* keep your current padding */
    z-index: 2000;              /* you already use this */
  }
}

/* Prevent background scroll when open (optional, but nice) */
body:has(#search-panel.open) { overflow: hidden; }

}



/* Hidden by default */
#mobile-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 32px);
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 24, 28, 0.92);
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;

  /* wider + multiline */
  padding: 14px 18px;
  max-width: clamp(280px, 92vw, 560px);
  border-radius: 14px;                /* looks intentional for 2 lines */
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  white-space: normal;
}

@supports (backdrop-filter: blur(6px)) {
  #mobile-toast {
    background: rgba(20, 24, 28, 0.70);
    backdrop-filter: blur(6px);
  }
}

/* Typographic hierarchy */
#mobile-toast .headline { font-weight: 600; margin-bottom: 4px; }
#mobile-toast .sub      { font-size: 0.85rem; opacity: 0.9; }
#mobile-toast .muted    { opacity: 0.75; }

/* Show it only on mobile-like contexts (either narrow or touch) */
@media (max-width: 760px) and (hover: none) and (pointer: coarse) {
  #mobile-toast {
    animation: toast-pop 5s 0.6s ease-out 1 forwards;
  }
}

/* Respect reduced motion users */
@media (prefers-reduced-motion: reduce) {
  #mobile-toast {
    animation: toast-fade 5s 0.6s ease-out 1 forwards;
  }
}

@keyframes toast-pop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(20px); }
  10%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(20px); visibility: hidden; }
}
@keyframes toast-fade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

/* Info toast (desktop + mobile) */
#info-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  transform: translate(-50%, 12px);
  background: rgba(20, 24, 28, 0.92);
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.3;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 2500;
}


/* Desktop-only / feature toast */
#feature-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  transform: translate(-50%, 12px);
  background: rgba(20, 24, 28, 0.92);
  color: #fff;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.3;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 2500;
}

