:root {
  --tb-subnav-height: var(--subnav-height);
  --tb-subnav-surface: #f6f6f6;
  --tb-subnav-divider: var(--tb-shell-divider-color);
  --tb-subnav-padding-inline: 12px;
  --tb-subnav-gap: 8px;
  --tb-subnav-action-gap: 8px;
  --tb-subnav-action-size: 36px;
  --tb-subnav-action-icon-size: 22px;
  --tb-subnav-radius: 8px;
  --tb-subnav-accent: #0059ff;
  --tb-subnav-active-surface: #e1ebf5;
  --tb-subnav-disabled-opacity: 0.38;
}

.tb-subnav {
  display: flex;
  align-items: center;
  min-width: 0;
  height: var(--tb-subnav-height);
  box-sizing: border-box;
  background: var(--tb-subnav-surface);
  border-top-color: var(--tb-subnav-divider);
  border-bottom-color: var(--tb-subnav-divider);
  overflow: visible;
}

.tb-subnav[hidden],
.tb-subnav [hidden] {
  display: none !important;
}

.tb-subnav__start,
.tb-subnav__content,
.tb-subnav__end {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}

.tb-subnav__start,
.tb-subnav__end {
  flex: 0 0 auto;
}

.tb-subnav__content {
  flex: 1 1 auto;
}

.tb-subnav__start:empty,
.tb-subnav__content:empty,
.tb-subnav__end:empty {
  display: none;
}

.tb-subnav--overflow-content .tb-subnav__content,
.tb-subnav--overflow-shell {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tb-subnav--overflow-content .tb-subnav__content::-webkit-scrollbar,
.tb-subnav--overflow-shell::-webkit-scrollbar {
  display: none;
}

.tb-subnav--overflow-none,
.tb-subnav--overflow-none .tb-subnav__content {
  overflow: visible;
}

.tb-subnav-tablist,
.tb-subnav-context-group,
.tb-subnav-control-group {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.tb-subnav-tablist {
  flex-wrap: nowrap;
}

.tb-subnav-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tb-subnav-tab:focus-visible,
.tb-subnav-compound-tab__close:focus-visible,
.tb-subnav-action:focus-visible {
  outline: 2px solid var(--tb-subnav-accent);
  outline-offset: -2px;
}

.tb-subnav-context-group {
  gap: var(--tb-subnav-gap);
}

.tb-subnav-divider {
  display: inline-flex;
  flex: 0 0 1px;
  width: 1px;
  height: 22px;
  margin: 0 14px;
  background: #d8e0ec;
}

.tb-subnav-compound-tab {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  height: calc(var(--tb-subnav-height) - 2px);
}

.tb-subnav-compound-tab__trigger {
  height: 100%;
  padding-right: 34px;
}

.tb-subnav-compound-tab__body {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tb-subnav-compound-tab__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.tb-subnav-compound-tab__label,
.tb-subnav-compound-tab__subtitle {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-subnav-compound-tab__subtitle {
  color: #667085;
  font-size: 12px;
}

.tb-subnav-compound-tab__close {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  opacity: 0.72;
  transform: translateY(-50%);
}

.tb-subnav-compound-tab__close::before,
.tb-subnav-compound-tab__close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 1.75px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.tb-subnav-compound-tab__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.tb-subnav-compound-tab__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.tb-subnav-compound-tab__close:hover,
.tb-subnav-compound-tab__close:focus-visible {
  border-color: var(--tb-subnav-accent);
  opacity: 1;
}

.tb-subnav-action {
  box-sizing: border-box;
}

.tb-subnav-text-action,
.tb-subnav-toggle {
  min-height: 36px;
  border: 1px solid #ccd5e1;
  border-radius: var(--tb-subnav-radius);
  background: #fff;
}

.tb-subnav-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.tb-subnav-flyout__panel,
.tb-subnav-popup {
  max-width: min(92vw, 420px);
}

.tb-subnav-popup {
  transform: translateX(var(--tb-subnav-popup-shift-x, 0px));
}

@media (max-width: 600px) {
  .tb-subnav.journaling-subnav .tb-subnav__start {
    flex: 0 1 52%;
    max-width: 52%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .tb-subnav.journaling-subnav .tb-subnav__content {
    flex: 0 0 0;
  }

  .tb-subnav.journaling-subnav .tb-subnav__end {
    flex: 1 1 48%;
    max-width: 48%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .tb-subnav.journaling-subnav .tb-subnav__start::-webkit-scrollbar,
  .tb-subnav.journaling-subnav .tb-subnav__end::-webkit-scrollbar {
    display: none;
  }

  .tb-subnav-popup.journaling-v1-panel .journaling-filters-layout {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
  }

  .tb-subnav-popup .journaling-filters-left {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tb-subnav-popup .journaling-filters-right {
    width: 100%;
    max-height: none;
    box-sizing: border-box;
    padding: 0;
    overflow: visible;
  }

  .tb-subnav-popup .journaling-dropdown-footer {
    gap: 8px;
    padding: 10px 12px;
  }

  .tb-subnav-popup .journaling-dropdown-footer-actions {
    gap: 6px;
  }

  .tb-subnav-popup .journaling-action {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tb-subnav *,
  .tb-subnav *::before,
  .tb-subnav *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
