#shortcuts-button {
  position: fixed;
  bottom: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  left: max(16px, env(safe-area-inset-left));
  padding: 16px;
  background-color: var(--bg-faded-blur-color);
  z-index: 101;
  transition: all 0.3s ease-in-out;
  border: var(--hairline-width) solid var(--bg-color);
  box-shadow: inset 0 -4px 16px -8px var(--button-bg-blur-color),
    0 3px 8px -1px var(--drop-shadow-color);
}
#shortcuts-button .icon {
  transform: translateY(2px); /* Balance the icon's vertical alignment */
}
#app:has(header[hidden]) #shortcuts-button,
#shortcuts-button[hidden] {
  transform: translateY(200%);
  pointer-events: none;
  user-select: none;
}
#shortcuts-button:is(:hover, :focus) {
  background-color: var(--bg-color);
  filter: none;
}
#shortcuts-button:active {
  transform: scale(0.95);
  transition: none;
}

@media (min-width: calc(40em + 56px + 8px)) {
  #shortcuts-button {
    right: 16px;
    right: max(16px, env(safe-area-inset-right));
    left: auto;
    top: 16px;
    top: max(16px, env(safe-area-inset-top));
    bottom: auto;
  }
  #app:has(header[hidden]) #shortcuts-button,
  #shortcuts-button[hidden] {
    transform: translateY(-200%);
  }
}

/* TAB BAR */

#shortcuts .tab-bar:not([hidden]) {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--bg-blur-color);
  backdrop-filter: blur(16px) saturate(3);
  border-top: var(--hairline-width) solid var(--outline-color);
  box-shadow: 0 -8px 16px -8px var(--drop-shadow-color);
  overflow: auto;
  transition: all 0.3s ease-in-out;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  user-select: none;
  -webkit-touch-callout: none;
}
#shortcuts .tab-bar ul {
  display: flex;
  margin: 0;
  padding: 0;
}
#shortcuts .tab-bar li {
  flex-grow: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
}
#shortcuts .tab-bar li a {
  display: block;
  color: var(--text-insignificant-color);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px;
  text-decoration: none;
  text-shadow: 0 var(--hairline-width) var(--bg-color);
  width: 20vw;
}
#shortcuts .tab-bar li a:active {
  transform: scale(0.95);
  transition: none;
}
#shortcuts .tab-bar li a * {
  pointer-events: none;
}
#shortcuts .tab-bar li a span {
  width: 100%;
  text-align: center;
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
#shortcuts .tab-bar li a.is-active {
  color: var(--link-color);
  background-image: radial-gradient(
    closest-side at 50% 50%,
    var(--bg-color),
    transparent
  );
}
#app:has(header[hidden]) #shortcuts .tab-bar,
shortcuts .tab-bar[hidden] {
  transform: translateY(200%);
  pointer-events: none;
  user-select: none;
}

@media (max-width: calc(40em - 1px)) {
  #app:has(#shortcuts .tab-bar) .deck-container {
    padding-bottom: 52px;
  }
}

@media (min-width: 40em) {
  #app:has(#shortcuts .tab-bar) .timeline-deck {
    margin-top: 44px;
  }
  #app:has(#shortcuts .tab-bar) .timeline-deck > header {
    --margin-top: calc(44px + 8px);
  }
  #shortcuts .tab-bar:not([hidden]) {
    top: 0;
    bottom: auto;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0
      env(safe-area-inset-left);
    background-color: var(--bg-faded-blur-color);
    border: 0;
    box-shadow: none;
    border-bottom: var(--hairline-width) solid var(--bg-faded-color);
  }
  #shortcuts .tab-bar ul:before {
    content: '';
    margin: auto;
  }
  #shortcuts .tab-bar ul:after {
    content: '';
    margin: auto;
  }
  #shortcuts .tab-bar li {
    flex-grow: 0;
  }
  #shortcuts .tab-bar li a {
    padding: 0 16px;
    width: auto;
    flex-direction: row;
    font-size: 14px;
    height: 44px;
    gap: 4px;
  }
  #app:has(header[hidden]) #shortcuts .tab-bar,
  shortcuts .tab-bar[hidden] {
    transform: translateY(-150%);
    pointer-events: none;
    user-select: none;
  }
}