body.hide-menu-toggle .floating-menu-button {
  opacity: 0;
  pointer-events: none;
}


.bottom-nav {
  position: fixed;
  left: auto;
  right: 16px;
  bottom: calc(34px + env(safe-area-inset-bottom));
  display: inline-flex;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  z-index: 650;
  pointer-events: auto;
}


.hamburger-menu {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}


.hamburger-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(8, 16, 22, 0.35);
}


.hamburger-panel {
  position: relative;
  right: 0;
  margin: 0 16px calc(120px + env(safe-area-inset-bottom));
  margin-left: auto;
  width: min(280px, calc(100vw - 32px));
  min-width: 220px;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-self: end;
}


.hamburger-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  min-height: 60px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-weight: 700;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}


.hamburger-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}


.floating-menu-button {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border) 62%);
  border-radius: 999px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 72%, var(--bg-elev) 28%), var(--bg-elev));
  color: var(--primary-strong);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 12px 22px rgba(18, 42, 50, 0.22);
}


.floating-menu-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
@media (min-width: 740px) {.bottom-nav {
    right: 18px;
  }}


.hamburger-fab-wrapper {
  position: fixed !important;
  right: 16px !important;
  bottom: calc(34px + env(safe-area-inset-bottom)) !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  z-index: 750 !important;
}


.hamburger-fab-wrapper .hamburger-fab {
  position: static !important;
}


.hamburger-fab {
  position: fixed !important;
  right: 16px !important;
  bottom: calc(34px + env(safe-area-inset-bottom)) !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 64px !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  align-self: auto !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  z-index: 750 !important;
  touch-action: manipulation;
  line-height: 1 !important;
  white-space: nowrap !important;
}


body.hide-menu-toggle .hamburger-fab {
  opacity: 0;
  pointer-events: none;
}


.hamburger-fab * {
  box-sizing: border-box;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
}


.hamburger-fab-icon {
  width: 24px !important;
  height: 18px !important;
  min-width: 24px !important;
  min-height: 18px !important;
  max-width: 24px !important;
  max-height: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  pointer-events: none;
}


.hamburger-fab-icon span {
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  min-height: 2px !important;
  max-height: 2px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: currentColor !important;
}

/* Legacy hybrid FAB: its .cp-icon also matches the bar-span rule above. Keep
   the flex layout that centers the glyph (formerly supplied by each theme's
   !important .cp-icon display); Graphite's glyph centers as block. */
.hamburger-fab-icon > .cp-icon {
  display: flex !important;
}

[data-theme="graphite"] .hamburger-fab-icon > .cp-icon {
  display: block !important;
}


/* ── Navigation hamburger items ────────────────────────────── */

[data-theme="cozy-pastel"] .hamburger-item {
  gap: 12px;
}


[data-theme="cozy-pastel"] .hamburger-item .cp-icon svg {
  width: 20px;
  height: 20px;
}




/* ── FAB hamburger button — hide CSS spans, show SVG ───────── */

[data-theme="cozy-pastel"] .hamburger-fab-icon > span:not(.cp-icon) {
  display: none;
}


[data-theme="cozy-pastel"] .hamburger-fab-icon .cp-icon svg {
  width: 22px;
  height: 22px;
}


[data-theme="cozy-pastel"] .hamburger-item {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(233, 238, 236, 0.96));
}


[data-theme="cozy-pastel"] .hamburger-item[data-menu-nav="home"] {
  border-left-color: var(--cozy-navy);
}


[data-theme="cozy-pastel"] .hamburger-item[data-menu-nav="results"] {
  border-left-color: var(--cozy-teal);
}


[data-theme="cozy-pastel"] .hamburger-item:hover,
[data-theme="cozy-pastel"] .hamburger-item:focus-visible,
[data-theme="cozy-pastel"] .hamburger-item.active {
  background: linear-gradient(135deg, rgba(54, 84, 107, 0.12), rgba(95, 158, 154, 0.1));
  border-color: rgba(54, 84, 107, 0.58);
}


[data-theme="cozy-pastel"] .hamburger-panel {
  background: var(--surface-primary);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}


[data-theme="cozy-pastel"] .hamburger-item {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  border-left: 3px solid transparent;
}


[data-theme="cozy-pastel"] .hamburger-item[data-menu-nav="home"] {
  border-left-color: var(--cozy-navy);
}


[data-theme="cozy-pastel"] .hamburger-item[data-menu-nav="results"] {
  border-left-color: var(--cozy-teal);
}


[data-theme="cozy-pastel"] .hamburger-item:hover,
[data-theme="cozy-pastel"] .hamburger-item:focus-visible,
[data-theme="cozy-pastel"] .hamburger-item.active {
  border-color: rgba(54, 84, 107, 0.58);
  background: rgba(54, 84, 107, 0.12);
}


[data-theme="cozy-pastel"] .floating-menu-button {
  background: linear-gradient(145deg, rgba(54, 84, 107, 0.18), rgba(95, 158, 154, 0.16));
  border-color: rgba(54, 84, 107, 0.64);
  color: #314959;
  box-shadow: var(--shadow-soft);
}


[data-theme="cyber-minimalism"] .hamburger-panel {
  background: linear-gradient(145deg, rgba(32, 48, 68, 0.98), rgba(18, 28, 40, 0.98));
  border: 1px solid var(--border-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}


[data-theme="cyber-minimalism"] .hamburger-item {
  background: linear-gradient(145deg, rgba(24, 37, 52, 0.98), rgba(18, 28, 40, 0.96));
  border-color: var(--border-primary);
  color: var(--text-primary);
  border-left: 3px solid transparent;
}


[data-theme="cyber-minimalism"] .hamburger-item[data-menu-nav="home"] {
  border-left-color: var(--cyber-cyan);
}


[data-theme="cyber-minimalism"] .hamburger-item[data-menu-nav="results"] {
  border-left-color: var(--cyber-teal);
}


[data-theme="cyber-minimalism"] .hamburger-item:hover,
[data-theme="cyber-minimalism"] .hamburger-item:focus-visible {
  border-color: var(--cyber-cyan);
  background: rgba(32, 199, 217, 0.12);
}


[data-theme="cyber-minimalism"] .hamburger-item.active {
  background: linear-gradient(135deg, rgba(32, 199, 217, 0.14), rgba(77, 124, 156, 0.12));
  border-color: color-mix(in srgb, var(--cyber-cyan) 58%, var(--cyber-blue) 42%);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.22);
}


[data-theme="cyber-minimalism"] .floating-menu-button {
  background: linear-gradient(145deg, rgba(32, 199, 217, 0.2), rgba(77, 124, 156, 0.16));
  border-color: color-mix(in srgb, var(--cyber-cyan) 46%, var(--cyber-steel) 54%);
  color: #d7f7ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}


/* ----- Hamburger Panel ----- */
[data-theme="graphite"] .hamburger-panel {
  background: linear-gradient(145deg, rgba(33, 44, 54, 0.98), rgba(24, 31, 38, 0.98));
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
}


[data-theme="graphite"] .hamburger-item {
  background: linear-gradient(145deg, rgba(30, 40, 50, 0.98), rgba(24, 32, 40, 0.96));
  border-color: var(--border);
  color: var(--text);
  border-left: 3px solid transparent;
}


[data-theme="graphite"] .hamburger-item[data-menu-nav="home"] {
  border-left-color: rgba(148, 174, 187, 0.52);
}


[data-theme="graphite"] .hamburger-item[data-menu-nav="results"] {
  border-left-color: rgba(179, 142, 69, 0.52);
}


[data-theme="graphite"] .hamburger-item:hover,
[data-theme="graphite"] .hamburger-item:focus-visible {
  border-color: rgba(148, 174, 187, 0.30);
  background: rgba(148, 174, 187, 0.08);
}


[data-theme="graphite"] .hamburger-item.active {
  background: linear-gradient(135deg, rgba(148, 174, 187, 0.12), rgba(88, 128, 160, 0.10));
  border-color: rgba(148, 174, 187, 0.34);
  box-shadow: inset 0 0 0 1px rgba(148, 174, 187, 0.15);
}


/* ----- Floating menu button ----- */
[data-theme="graphite"] .floating-menu-button {
  background: linear-gradient(145deg, rgba(33, 45, 56, 0.96), rgba(24, 32, 42, 0.96));
  border-color: rgba(148, 174, 187, 0.26);
  color: var(--graphite-200);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34);
}


/* ── FLOATING ACTION BUTTON ────────────────────────────────── */

[data-theme="graphite"] .floating-menu-button {
  background: rgba(14, 20, 32, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #adc8d6;
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.56),
    0 1px 0 rgba(255, 255, 255, 0.10) inset,
    0 0 24px rgba(122, 170, 187, 0.08);
  transition: all 0.20s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 900;
}


[data-theme="graphite"] .floating-menu-button:hover,
[data-theme="graphite"] .floating-menu-button:focus {
  transform: translateY(-4px);
  box-shadow: 
    0 24px 56px rgba(0, 0, 0, 0.64),
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 0 32px rgba(122, 170, 187, 0.14);
  border-color: rgba(255, 255, 255, 0.20);
}


[data-theme="graphite"] .floating-menu-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.44);
}


/* ── HAMBURGER MENU ────────────────────────────────────────── */

[data-theme="graphite"] .hamburger-panel {
  background: rgba(6, 9, 16, 0.92);
  backdrop-filter: blur(32px) saturate(1.8);
  -webkit-backdrop-filter: blur(32px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 24px 64px rgba(0, 0, 0, 0.72),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}


[data-theme="graphite"] .hamburger-item {
  background: rgba(14, 20, 32, 0.70);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}


[data-theme="graphite"] .hamburger-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  opacity: 0;
  transition: opacity 0.15s ease;
}


[data-theme="graphite"] .hamburger-item:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(20, 30, 48, 0.90);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.40);
}


[data-theme="graphite"] .hamburger-item:hover::before {
  opacity: 1;
}


[data-theme="graphite"] .hamburger-item.active {
  border-color: rgba(122, 170, 187, 0.40);
  background: rgba(122, 170, 187, 0.10);
  box-shadow: 
    0 0 0 1px rgba(122, 170, 187, 0.20) inset,
    0 0 20px rgba(122, 170, 187, 0.10);
  color: #adc8d6;
}


/* ── BOTTOM PADDING FOR FLOATING ELEMENTS ──────────────────── */

[data-theme="graphite"] .bottom-nav {
  gap: 8px;
}


[data-theme="graphite"] .floating-menu-button {
  animation: iris-float 4s ease-in-out infinite;
}


/* ── HAMBURGER PANEL: VOID GLASS ─────────────────────────────── */

[data-theme="graphite"] .hamburger-panel {
  background: rgba(2, 3, 10, 0.94);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.90),
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 60px rgba(77, 159, 255, 0.06);
}


[data-theme="graphite"] .hamburger-item.active {
  border-color: rgba(77, 159, 255, 0.42);
  background: rgba(77, 159, 255, 0.10);
  box-shadow:
    0 0 0 1px rgba(77, 159, 255, 0.20) inset,
    0 0 24px rgba(77, 159, 255, 0.12);
  color: #90c8ff;
}


/* ── FAB: PRISMATIC ──────────────────────────────────────────── */

[data-theme="graphite"] .floating-menu-button {
  background: rgba(4, 6, 18, 0.92);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #90c8ff;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 900;
  font-size: 1.5rem;
}


[data-theme="graphite"] .floating-menu-button:hover,
[data-theme="graphite"] .floating-menu-button:focus {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.24);
  animation: none;
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.80),
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 0 48px rgba(77,  159, 255, 0.20),
    0 0 80px rgba(168, 120, 255, 0.10);
}


[data-theme="graphite"] .floating-menu-button:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.60);
  animation: none;
}


/* ── HAMBURGER NAV ICONS ─────────────────────────────────── */
/* Graphite styles every menu item's shared .cp-icon as thin, compact blue line
   art (the look of its former ::before asset icons). The ::before above stays a
   decorative hover sheen only. */
[data-theme="graphite"] .hamburger-item .cp-icon {
  width: 20px;
  height: 20px;
  color: #90c8ff;
}

[data-theme="graphite"] .hamburger-item .cp-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}


[data-theme="pulse"] .hamburger-item:not(.active),
[data-theme="pulse"] .nav-btn:not(.active) {
  border-color: rgba(155, 178, 224, 0.14);
}
