/* var.106 — approved final floating controls layout */
:root {
  --floating-control-height: 44px;
  --floating-control-width: 112px;
  --floating-control-gap: 10px;
  --floating-edge: max(14px, env(safe-area-inset-left));
  --floating-edge-right: max(14px, env(safe-area-inset-right));
  --floating-bottom: calc(18px + env(safe-area-inset-bottom));
  --floating-dark-green: #0e5f5f;
  --floating-green: #07943f;
}

/* Matching left and right two-button columns. */
.quick-nav-trigger,
.site-search-trigger,
.site-audio-control,
.grafo-music-button {
  box-sizing: border-box !important;
  width: var(--floating-control-width) !important;
  height: var(--floating-control-height) !important;
  min-width: var(--floating-control-width) !important;
  min-height: var(--floating-control-height) !important;
  max-width: var(--floating-control-width) !important;
  border: 2px solid rgba(255,255,255,.92) !important;
  border-radius: 999px !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.27) !important;
  font-family: Arial, sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}
.quick-nav-trigger,
.site-search-trigger,
.grafo-music-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 0 14px !important;
}
.quick-nav-trigger,
.site-audio-control { background: var(--floating-dark-green) !important; }
.site-search-trigger,
.grafo-music-button { background: var(--floating-green) !important; }

/* Left: page search above site search. */
.quick-nav-trigger,
.site-search-trigger { left: var(--floating-edge) !important; }
.site-search-trigger { bottom: var(--floating-bottom) !important; }
.quick-nav-trigger {
  bottom: calc(var(--floating-bottom) + var(--floating-control-height) + var(--floating-control-gap)) !important;
}
.quick-nav-trigger svg,
.site-search-trigger svg,
.grafo-music-button svg {
  flex: 0 0 auto;
  width: 22px !important;
  height: 22px !important;
  color: currentColor;
}
.quick-nav-trigger__label,
.site-search-trigger__label,
.grafo-music-button__label { white-space: nowrap; }
.site-search-trigger__badge { display: none !important; }

/* Right: sound above music, same dimensions as the matching left buttons. */
.grafo-music-control {
  right: var(--floating-edge-right) !important;
  bottom: var(--floating-bottom) !important;
  width: var(--floating-control-width) !important;
  max-width: var(--floating-control-width) !important;
  align-items: stretch !important;
}
.grafo-music-button { padding: 0 12px !important; }
.grafo-music-button.is-off { background: #49725f !important; }
.grafo-music-notice {
  position: absolute;
  right: 0;
  bottom: calc(var(--floating-control-height) + var(--floating-control-gap));
  width: min(320px, calc(100vw - 28px));
}
.site-audio-control {
  right: var(--floating-edge-right) !important;
  bottom: calc(var(--floating-bottom) + var(--floating-control-height) + var(--floating-control-gap)) !important;
  display: grid !important;
  grid-template-columns: 1fr 28px !important;
  overflow: hidden !important;
  z-index: 10051 !important;
}
.site-audio-toggle,
.site-audio-voice-open {
  height: var(--floating-control-height) !important;
  min-height: var(--floating-control-height) !important;
  color: #fff !important;
}
.site-audio-toggle {
  width: auto !important;
  padding: 0 2px 0 10px !important;
  gap: 7px !important;
  border-radius: 999px 0 0 999px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
.site-audio-toggle__icon { font-size: 20px; line-height: 1; }
.site-audio-toggle__label { white-space: nowrap; }
.site-audio-voice-open {
  width: 28px !important;
  padding: 0 !important;
  border-left-color: rgba(255,255,255,.28) !important;
  border-radius: 0 999px 999px 0 !important;
}
.site-audio-control[data-enabled="false"] { opacity: .82 !important; }
.site-audio-panel {
  right: var(--floating-edge-right) !important;
  bottom: calc(var(--floating-bottom) + (var(--floating-control-height) * 2) + (var(--floating-control-gap) * 2)) !important;
}

/* Approved up arrow: plain green arrow, no disc, centered above Sound. */
#upbutton {
  right: calc(var(--floating-edge-right) + (var(--floating-control-width) - 44px) / 2) !important;
  bottom: calc(var(--floating-bottom) + (var(--floating-control-height) * 2) + (var(--floating-control-gap) * 2)) !important;
  width: 44px !important;
  height: 44px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#upbutton svg { width: 44px !important; height: 44px !important; }
#upbutton img { display: none !important; }

@media (max-width: 640px) {
  :root {
    --floating-control-width: 106px;
    --floating-control-gap: 8px;
    --floating-edge: max(10px, env(safe-area-inset-left));
    --floating-edge-right: max(10px, env(safe-area-inset-right));
    --floating-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .quick-nav-trigger,
  .site-search-trigger,
  .grafo-music-button { padding-left: 11px !important; padding-right: 11px !important; }
}

@media print {
  .quick-nav-trigger,
  .site-search-trigger,
  .site-audio-control,
  .site-audio-panel,
  .grafo-music-control,
  #upbutton { display: none !important; }
}

/* v.534 — canonical sitewide theme toggle, identical to the approved home-page control. */
html body #themeToggle.theme-toggle,
html body .theme-toggle {
  position: fixed !important;
  left: max(14px, env(safe-area-inset-left)) !important;
  right: auto !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  bottom: auto !important;
  z-index: 2147483000 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  border-radius: 50% !important;
  background: #0d5c63 !important;
  background-color: #0d5c63 !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.28) !important;
  text-shadow: none !important;
  filter: none !important;
  transform: none !important;
  cursor: pointer !important;
  font-family: Arial, sans-serif !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
  overflow: hidden !important;
  opacity: 1 !important;
  visibility: visible !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

html body #themeToggle.theme-toggle:hover,
html body #themeToggle.theme-toggle:active,
html body #themeToggle.theme-toggle:focus,
html body .theme-toggle:hover,
html body .theme-toggle:active,
html body .theme-toggle:focus {
  border-color: rgba(255,255,255,.45) !important;
  background: #0d5c63 !important;
  background-color: #0d5c63 !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.28) !important;
  transform: none !important;
}

html body #themeToggle.theme-toggle:focus-visible,
html body .theme-toggle:focus-visible {
  outline: 3px solid rgba(143,208,212,.75) !important;
  outline-offset: 3px !important;
}

@media (max-width: 700px) {
  html body #themeToggle.theme-toggle,
  html body .theme-toggle {
    left: max(10px, env(safe-area-inset-left)) !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    font-size: 20px !important;
  }
}

@media print {
  html body #themeToggle.theme-toggle,
  html body .theme-toggle {
    display: none !important;
  }
}

