.bd-app-dock {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%);
  width: min(940px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 26px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(19, 44, 99, 0.08);
  box-shadow: 0 20px 40px rgba(11, 21, 38, 0.18);
  backdrop-filter: blur(14px);
  z-index: 9997;
  transition: opacity .18s ease, transform .18s ease;
}

.bd-app-dock__track,
.bd-app-dock__pager,
.bd-app-dock__peek {
  display: none;
}

.bd-app-dock.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
}

.bd-app-dock__item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px 9px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #1a237e;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.bd-app-dock__item:active,
.bd-app-dock__item:hover {
  transform: translateY(-1px);
  background: rgba(19, 44, 99, 0.06);
}

.bd-app-dock__item.is-active {
  background: rgba(212, 175, 55, 0.14);
  color: #132c63;
}

.bd-app-dock__icon {
  font-size: 1.15rem;
  line-height: 1;
}

.bd-app-dock__label {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.bd-app-dock-safe-space {
  display: block;
  height: calc(98px + env(safe-area-inset-bottom, 0px));
}

.bd-app-dock-target {
  animation: bd-app-dock-pulse 1.2s ease;
}

@keyframes bd-app-dock-pulse {
  0% { box-shadow: 0 0 0 rgba(212, 175, 55, 0); }
  30% { box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.18); }
  100% { box-shadow: 0 0 0 rgba(212, 175, 55, 0); }
}

@media (max-width: 768px) {
  .bd-app-dock {
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    width: auto;
    transform: none;
    display: block;
    padding: 8px 8px 24px;
  }

  .bd-app-dock.is-hidden {
    transform: translateY(18px);
  }

  .bd-app-dock.is-auto-hidden {
    transform: translateY(calc(100% - 18px - env(safe-area-inset-bottom, 0px)));
  }

  .bd-app-dock > .bd-app-dock__item {
    display: none;
  }

  .bd-app-dock__track {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
  }

  .bd-app-dock__track::-webkit-scrollbar {
    display: none;
  }

  .bd-app-dock__page {
    flex: 0 0 100%;
    min-width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    scroll-snap-align: start;
    position: relative;
  }

  .bd-app-dock__page:last-child::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 26px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 253, 248, 0), rgba(255, 253, 248, 0.92));
  }

  .bd-app-dock__page .bd-app-dock__item {
    min-height: 74px;
    gap: 6px;
    padding: 9px 6px 8px;
    border-radius: 18px;
  }

  .bd-app-dock__icon {
    font-size: 1.22rem;
  }

  .bd-app-dock__label {
    font-size: 0.68rem;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
  }

  .bd-app-dock__pager {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }

  .bd-app-dock__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(19, 44, 99, 0.2);
    cursor: pointer;
    transition: transform .18s ease, background .18s ease;
  }

  .bd-app-dock__dot.is-active {
    background: rgba(19, 44, 99, 0.72);
    transform: scale(1.08);
  }

  .bd-app-dock__peek {
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 8px 18px rgba(11, 21, 38, 0.12);
    cursor: pointer;
  }

  .bd-app-dock__peek::before {
    content: "";
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: rgba(19, 44, 99, 0.24);
  }

  .bd-app-dock-safe-space {
    height: calc(98px + env(safe-area-inset-bottom, 0px));
  }

  .bd-app-dock-safe-space.is-dock-hidden {
    height: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

[data-theme="dark"] .bd-app-dock {
  background: rgba(9, 14, 28, 0.92);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 22px 46px rgba(0,0,0,0.34);
}

[data-theme="dark"] .bd-app-dock__item {
  color: #dbe5f4;
}

[data-theme="dark"] .bd-app-dock__item:active,
[data-theme="dark"] .bd-app-dock__item:hover {
  background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .bd-app-dock__item.is-active {
  background: rgba(245, 211, 106, 0.14);
  color: #f8e7af;
}

@media (max-width: 768px) {
  [data-theme="dark"] .bd-app-dock__page:last-child::after {
    background: linear-gradient(90deg, rgba(9, 14, 28, 0), rgba(9, 14, 28, 0.96));
  }

  [data-theme="dark"] .bd-app-dock__dot {
    background: rgba(219, 229, 244, 0.24);
  }

  [data-theme="dark"] .bd-app-dock__dot.is-active {
    background: rgba(248, 231, 175, 0.92);
  }

  [data-theme="dark"] .bd-app-dock__peek {
    background: rgba(17, 24, 39, 0.96);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  }

  [data-theme="dark"] .bd-app-dock__peek::before {
    background: rgba(219, 229, 244, 0.3);
  }
}

.bd-tools-sidebar-overlay {
  z-index: 99998 !important;
}

#sidebar-menu.bd-tools-sidebar {
  top: var(--bd-tools-sidebar-top-offset, 12px);
  left: 12px;
  width: min(360px, calc(100vw - 24px));
  height: calc(100dvh - var(--bd-tools-sidebar-top-offset, 12px) - 12px);
  padding: 18px 18px 22px;
  border: 1px solid rgba(19, 44, 99, 0.08);
  border-radius: 28px;
  box-shadow: 0 28px 64px rgba(11, 21, 38, 0.18);
  z-index: 99999 !important;
}

.bd-tools-sidebar .sidebar-header {
  padding-bottom: 16px;
}

.bd-tools-sidebar .sidebar-logo img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.bd-tools-sidebar .sidebar-title .bd-nom {
  font-size: 1.02rem;
}

.bd-tools-sidebar .sidebar-title .bd-sub {
  font-size: 0.94rem;
  line-height: 1.2;
}

.bd-tools-sidebar .sidebar-nav {
  gap: 8px;
  padding-bottom: 12px;
}

.bd-tools-sidebar .sidebar-section-title,
.bd-tools-sidebar .eines-head__title {
  margin: 18px 4px 8px;
}

.bd-tools-sidebar .sidebar-link {
  min-height: 56px;
  padding: 14px 16px;
  text-decoration: none;
  border-radius: 18px;
}

.bd-tools-sidebar .sidebar-link:hover {
  transform: none;
}

.bd-tools-sidebar .sidebar-left {
  gap: 12px;
}

.bd-tools-sidebar .sidebar-left,
.bd-tools-sidebar .sidebar-right,
.bd-tools-sidebar .sidebar-link span {
  text-decoration: none;
}

.bd-tools-sidebar .sidebar-left span:last-child {
  font-size: 1.02rem;
  font-weight: 700;
}

.bd-tools-sidebar .sidebar-close {
  flex-shrink: 0;
}

.bd-tools-sidebar .sidebar-divider {
  height: 1px;
  margin: 8px 2px;
  background: rgba(19, 44, 99, 0.08);
}

.bd-tools-sidebar .eines-head__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bd-tools-sidebar .eines-head__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.26);
  background: linear-gradient(135deg, rgba(255, 250, 232, 0.98), rgba(250, 239, 198, 0.88));
  color: #9a6b00;
  font-size: 0.96rem;
  font-weight: 800;
  white-space: nowrap;
}

.bd-tools-sidebar .eines-box {
  padding: 12px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.92), rgba(242, 246, 255, 0.86));
}

@media (max-width: 768px) {
  #sidebar-menu.bd-tools-sidebar {
    left: 10px;
    width: calc(100vw - 20px);
    height: calc(100dvh - var(--bd-tools-sidebar-top-offset, 12px) - 10px);
    padding: 16px 16px 20px;
    border-radius: 24px;
  }

  .bd-tools-sidebar .sidebar-link {
    min-height: 54px;
    padding: 13px 14px;
  }

  .bd-tools-sidebar .eines-head__top {
    flex-wrap: wrap;
  }

  .bd-tools-sidebar .eines-head__pill {
    min-height: 34px;
    font-size: 0.88rem;
    padding: 0 14px;
  }
}
