:root {
  --tl-nav-bg: #10131c;
  --tl-nav-panel: #0b0f1a;
  --tl-nav-panel-hover: #151d31;
  --tl-nav-border: #243055;
  --tl-nav-border-soft: #1e2842;
  --tl-nav-text: #b8bfd3;
  --tl-nav-text-strong: #ffffff;
  --tl-nav-blue: #4a8bff;
  --tl-nav-blue-soft: rgba(74, 139, 255, 0.18);
  --tl-nav-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.tl-navbar,
.tl-navbar * {
  box-sizing: border-box;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tl-navbar {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 16px 24px;
  color: var(--tl-nav-text);
  background:
    radial-gradient(circle at 10% 0%, rgba(74, 139, 255, 0.07), transparent 34%),
    var(--tl-nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.tl-navbar__left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 18px;
}

.tl-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
}

.tl-brand__name {
  display: inline-flex;
  align-items: baseline;
  color: var(--tl-nav-text-strong);
  font-size: 1.5rem;
  font-weight: 950;
  letter-spacing: -0.035em;
}

.tl-brand__main {
  color: #fff;
}

.tl-brand__accent {
  color: var(--tl-nav-blue);
  text-shadow: 0 0 18px rgba(74, 139, 255, 0.22);
}

.tl-brand:focus-visible,
.tl-navbar a:focus-visible,
.tl-navbar button:focus-visible {
  outline: 2px solid rgba(74, 139, 255, 0.5);
  outline-offset: 3px;
}

.tl-navbar__links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tl-navbar__links > a,
.tl-categories__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: var(--tl-nav-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.tl-navbar__links > a svg,
.tl-categories__trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-navbar__links > a:hover,
.tl-categories__trigger:hover {
  color: var(--tl-nav-text-strong);
  background: var(--tl-nav-panel-hover);
  border-color: var(--tl-nav-border);
  transform: translateY(-1px);
}

.tl-navbar__links > a.is-active,
.tl-categories__trigger.is-active {
  color: var(--tl-nav-text-strong);
  background: var(--tl-nav-blue-soft);
  border-color: rgba(74, 139, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(74, 139, 255, 0.06);
}

.tl-categories {
  position: relative;
}

.tl-categories__caret {
  margin-left: 4px;
  opacity: 0.8;
  transition: transform 160ms ease;
}

.tl-categories.is-open .tl-categories__caret {
  transform: rotate(180deg);
}

.tl-categories__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1200;
  display: none;
  min-width: 680px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  background: var(--tl-nav-bg);
  border: 1px solid var(--tl-nav-border-soft);
  border-radius: 16px;
  box-shadow: var(--tl-nav-shadow);
}

.tl-categories__menu a {
  display: block;
  padding: 8px 10px;
  color: var(--tl-nav-text);
  border-radius: 12px;
  font-size: 0.95rem;
  text-decoration: none;
  break-inside: avoid;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.tl-categories__menu a:hover {
  color: var(--tl-nav-text-strong);
  background: var(--tl-nav-panel-hover);
}

.tl-categories__empty {
  display: block;
  padding: 8px 10px;
  color: #9aa4b2;
  font-size: 0.9rem;
}

.tl-navbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
}

.tl-navbar__search,
.tl-navbar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  color: #cfe0ff;
  background: var(--tl-nav-panel);
  border: 1px solid var(--tl-nav-border);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.tl-navbar__search {
  text-decoration: none;
}

.tl-navbar__search svg,
.tl-navbar__toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-navbar__search:hover,
.tl-navbar__toggle:hover {
  color: var(--tl-nav-text-strong);
  background: var(--tl-nav-panel-hover);
  border-color: #3c5d9b;
  transform: translateY(-1px);
}

.tl-navbar__search.is-active {
  color: var(--tl-nav-text-strong);
  background: var(--tl-nav-blue-soft);
  border-color: rgba(74, 139, 255, 0.46);
}

.tl-navbar__toggle {
  display: none;
}

.tl-navbar__toggle-close {
  display: none;
}

.tl-navbar__toggle.is-open .tl-navbar__toggle-menu {
  display: none;
}

.tl-navbar__toggle.is-open .tl-navbar__toggle-close {
  display: block;
}

@media (min-width: 1241px) {
  .tl-categories.is-open .tl-categories__menu {
    display: block;
    column-count: 3;
    column-gap: 10px;
  }

  .tl-categories__menu a {
    margin-bottom: 6px;
  }
}

@media (max-width: 1240px) {
  .tl-navbar {
    min-height: 74px;
    padding: 16px;
  }

  .tl-navbar__left {
    gap: 14px;
  }

  .tl-brand__name {
    font-size: 1.28rem;
    letter-spacing: -0.03em;
  }

  .tl-navbar__toggle {
    display: inline-flex;
    border-radius: 12px;
  }

  .tl-navbar__links {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1300;
    display: none;
    width: 100%;
    max-height: calc(100dvh - 74px);
    padding: 12px 0 calc(120px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--tl-nav-bg);
    border-top: 1px solid var(--tl-nav-border-soft);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .tl-navbar__links.is-open {
    display: flex;
  }

  .tl-navbar__links > a,
  .tl-categories__trigger {
    justify-content: flex-start;
    width: 100%;
    padding: 12px 20px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    text-align: left;
    transform: none;
  }

  .tl-categories {
    width: 100%;
  }

  .tl-categories__menu {
    position: relative;
    top: auto;
    left: auto;
    display: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 6px 12px 14px;
    column-count: 2;
    column-gap: 10px;
    background: #0f1320;
    border: 0;
    border-top: 1px solid var(--tl-nav-border-soft);
    border-radius: 0;
    box-shadow: none;
  }

  .tl-categories.is-open .tl-categories__menu {
    display: block;
  }

  .tl-categories__menu::after {
    position: absolute;
    right: 0;
    bottom: 6px;
    left: 0;
    height: 1px;
    background: var(--tl-nav-border-soft);
    content: "";
  }

  .tl-categories__menu a {
    min-width: 0;
    margin-bottom: 6px;
    padding: 8px 6px;
    overflow-wrap: anywhere;
  }

  .tl-navbar__actions {
    margin-left: auto;
  }

  .tl-navbar__search {
    border-radius: 12px;
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 1240px) {
    .tl-navbar__links {
      max-height: calc(100vh - 74px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-navbar * {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* ===== Conta, avatar e notificações ===== */
.tl-notifications,
.tl-profile {
  position: relative;
}

.tl-navbar__notification-button,
.tl-navbar__profile-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0;
  color: #cfe0ff;
  line-height: 0;
  vertical-align: middle;
  background: var(--tl-nav-panel);
  border: 1px solid var(--tl-nav-border);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.tl-navbar__notification-button svg,
.tl-navbar__profile-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-navbar__notification-button:hover,
.tl-navbar__profile-button:hover {
  color: var(--tl-nav-text-strong);
  background: var(--tl-nav-panel-hover);
  border-color: #3c5d9b;
  transform: translateY(-1px);
}

.tl-navbar__notification-button:focus-visible,
.tl-navbar__profile-button:focus-visible {
  outline: 2px solid rgba(74, 139, 255, 0.5);
  outline-offset: 3px;
}

.tl-notifications.is-open .tl-navbar__notification-button,
.tl-profile.is-open .tl-navbar__profile-button,
.tl-navbar__profile-button.is-active {
  color: var(--tl-nav-text-strong);
  background: var(--tl-nav-blue-soft);
  border-color: rgba(74, 139, 255, 0.46);
}

.tl-navbar__profile-button.has-avatar {
  overflow: hidden;
}

.tl-profile__avatar-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.tl-notifications__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  background: var(--tl-nav-blue);
  border: 2px solid var(--tl-nav-bg);
  border-radius: 999px;
  box-shadow:
    0 0 0 3px rgba(74, 139, 255, 0.16),
    0 0 18px rgba(74, 139, 255, 0.28);
}

.tl-notifications__badge[hidden],
.tl-notifications__list[hidden] {
  display: none !important;
}

.tl-notifications__menu,
.tl-profile__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  color: var(--tl-nav-text);
  background: var(--tl-nav-bg);
  border: 1px solid var(--tl-nav-border-soft);
  border-radius: 16px;
  box-shadow: var(--tl-nav-shadow);
}

.tl-notifications__menu {
  z-index: 1450;
  width: 340px;
  max-width: calc(100vw - 24px);
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 10px;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

.tl-profile__menu {
  z-index: 1400;
  width: 220px;
  padding: 8px;
}

.tl-notifications.is-open .tl-notifications__menu,
.tl-profile.is-open .tl-profile__menu {
  display: block;
}

.tl-notifications__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--tl-nav-border-soft);
}

.tl-notifications__header strong {
  color: #e7ecff;
  font-size: 0.95rem;
}

.tl-notifications__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #cfe0ff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  background: var(--tl-nav-panel);
  border: 1px solid var(--tl-nav-border);
  border-radius: 12px;
  cursor: pointer;
}

.tl-notifications__close:hover {
  color: #fff;
  background: var(--tl-nav-panel-hover);
}

.tl-notifications__loading,
.tl-notifications__empty {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 12px 10px;
  overflow: visible !important;
  color: #9fb0d1;
  font-size: 0.92rem;
}

.tl-notifications__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 10px;
  overflow: visible !important;
  color: #e7ecff;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.tl-notifications__item:hover,
.tl-notifications__item:focus-visible {
  background: var(--tl-nav-panel-hover);
  outline: none;
}

.tl-notifications__dot {
  width: 8px;
  height: 8px;
  margin-top: 14px;
  flex: 0 0 auto;
  background: var(--tl-nav-blue);
  border-radius: 999px;
  opacity: 0;
}

.tl-notifications__dot.is-unread {
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(74, 139, 255, 0.12);
}

.tl-notifications__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  overflow: hidden;
  color: #cfe0ff;
  background: var(--tl-nav-panel);
  border: 1px solid var(--tl-nav-border);
  border-radius: 999px;
}

.tl-notifications__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tl-notifications__item.is-episode .tl-notifications__avatar {
  border-radius: 8px;
}

.tl-notifications__item.is-episode .tl-notifications__user:hover {
  text-decoration: none;
}

.tl-notifications__avatar svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: none;
}

.tl-notifications__text {
  min-width: 0;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  flex: 1;
}

.tl-notifications__title {
  display: block;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  color: #e7ecff;
  font-size: 0.91rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.tl-notifications__user {
  color: #9ec5ff;
  font-weight: 950;
  text-decoration: none;
}

.tl-notifications__user:hover {
  text-decoration: underline;
}

.tl-notifications__action {
  color: #e7ecff;
}

.tl-notifications__meta {
  display: block;
  height: auto !important;
  max-height: none !important;
  margin-top: 4px;
  overflow: visible !important;
  color: #9aa4b2;
  font-size: 0.8rem;
}

.tl-notifications__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tl-notifications__action-button {
  min-height: 30px;
  padding: 6px 10px;
  color: #cfe0ff;
  font-size: 0.78rem;
  font-weight: 900;
  background: var(--tl-nav-panel);
  border: 1px solid var(--tl-nav-border);
  border-radius: 10px;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.tl-notifications__action-button:hover:not(:disabled) {
  color: #fff;
  background: var(--tl-nav-panel-hover);
  border-color: #3c5d9b;
  transform: translateY(-1px);
}

.tl-notifications__action-button.is-accept {
  color: #fff;
  background: var(--tl-nav-blue);
  border-color: var(--tl-nav-blue);
}

.tl-notifications__action-button.is-decline:hover:not(:disabled) {
  color: #ffd0d0;
  background: rgba(255, 80, 80, 0.12);
  border-color: rgba(255, 80, 80, 0.32);
}

.tl-notifications__action-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.tl-notifications__footer {
  display: block;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin-top: 6px;
  padding: 10px;
  overflow: visible !important;
  color: #9ec5ff;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  background: var(--tl-nav-panel);
  border: 1px solid var(--tl-nav-border);
  border-radius: 12px;
}

.tl-notifications__footer:hover {
  color: #fff;
  background: var(--tl-nav-panel-hover);
}

.tl-profile__menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  color: var(--tl-nav-text);
  font-size: 0.94rem;
  text-decoration: none;
  border-radius: 12px;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.tl-profile__menu a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-profile__menu a:hover,
.tl-profile__menu a.is-active {
  color: #fff;
  background: var(--tl-nav-panel-hover);
}

.tl-profile__menu a.tl-profile__register {
  margin-top: 4px;
  color: #fff;
  background: var(--tl-nav-blue);
}

.tl-profile__menu a.tl-profile__register:hover {
  filter: brightness(1.08);
}

.tl-profile__menu a.tl-profile__logout {
  color: #ffb4b4;
}

.tl-profile__menu a.tl-profile__logout:hover {
  color: #ffd0d0;
  background: rgba(255, 80, 80, 0.12);
}

@media (max-width: 1240px) {
  .tl-navbar__notification-button,
  .tl-navbar__profile-button {
    border-radius: 12px;
  }
}

@media (max-width: 380px) {
  .tl-navbar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .tl-navbar__left {
    gap: 8px;
  }

  .tl-brand__name {
    font-size: 1.05rem;
  }

  .tl-navbar__actions {
    gap: 6px;
    margin-left: 8px;
  }

  .tl-navbar__search,
  .tl-navbar__toggle,
  .tl-navbar__notification-button,
  .tl-navbar__profile-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    max-width: 38px;
    min-height: 38px;
    max-height: 38px;
  }
}
