[data-burger-menu],
[data-burger-menu] * {
  box-sizing: border-box;
}

[data-burger-menu][hidden] {
  display: none;
}

.twn-burger-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
}

.twn-burger__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(20, 13, 28, 0.18);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.twn-burger {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 80px);
  bottom: auto;
  left: max(16px, calc((100vw - 360px) / 2 + 16px));
  width: min(288px, calc(100vw - 32px));
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--tw-bottom-nav-content-offset, 112px) - 96px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
  background: #f7f7f9;
  color: #1a1a1f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transform: translateX(0);
  animation: twn-burger-in 180ms ease-out both;
}

.twn-burger__top,
.twn-burger__group,
.twn-burger__bottom {
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
}

.twn-burger__scroll {
  min-height: 0;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.twn-burger__scroll::-webkit-scrollbar {
  display: none;
}

.twn-burger__profile {
  min-width: 0;
  min-height: 80px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 16px;
  align-items: center;
  column-gap: 12px;
  padding: 16px;
  color: #1a1a1f;
  text-decoration: none;
}

.twn-burger__avatar {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: #eee8ff;
  color: #5b23d3;
  font-size: 16px;
  line-height: 1;
  font-weight: 750;
}

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

.twn-burger__profile-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
}

.twn-burger__profile-copy strong,
.twn-burger__profile-copy small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.twn-burger__profile-copy strong {
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
}

.twn-burger__profile-copy small {
  grid-column: 1 / -1;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
  line-height: 16px;
  font-weight: 450;
}

.twn-burger__rating {
  color: #1a1a1f;
  font-size: 12px;
  line-height: 16px;
  font-weight: 650;
  white-space: nowrap;
}

.twn-burger__rating b {
  color: #ffb800;
}

.twn-burger__profile-chevron,
.twn-burger__chevron {
  color: #6b7280;
  width: 20px;
  height: 20px;
  line-height: 0;
  text-align: center;
}

.twn-burger__profile-chevron svg,
.twn-burger__chevron svg {
  display: block;
  width: 100%;
  height: 100%;
}

.twn-burger__role-switch {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 16px 16px;
  padding: 4px;
  border-radius: 14px;
  background: #f1eef8;
}

.twn-burger__role-switch a {
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 8px;
  border-radius: 10px;
  color: #6b7280;
  font-size: 12px;
  line-height: 16px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.twn-burger__role-switch a.is-current {
  background: #ffffff;
  color: #5b23d3;
  box-shadow: 0 1px 5px rgba(55, 20, 81, 0.12);
}

.twn-burger__row {
  position: relative;
  min-width: 0;
  height: 56px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  align-items: center;
  column-gap: 12px;
  padding: 0 16px;
  color: #1a1a1f;
  text-decoration: none;
}

.twn-burger__row + .twn-burger__row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  left: 52px;
  height: 1px;
  background: #e6e6ec;
}

.twn-burger__row-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
}

.twn-burger__row-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.twn-burger__row-label {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 14px;
  line-height: 19px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.twn-burger__bottom {
  margin-top: 0;
}

.twn-burger__version {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 16px;
}

.twn-burger__row--danger,
.twn-burger__row--danger .twn-burger__row-icon,
.twn-burger__row--danger .twn-burger__chevron {
  color: #ef4444;
}

.twn-burger__profile:focus-visible,
.twn-burger__role-switch a:focus-visible,
.twn-burger__row:focus-visible {
  outline: 2px solid #5b23d3;
  outline-offset: -2px;
}

.twn-burger:focus-visible,
.twn-burger__backdrop:focus-visible {
  outline: none;
}

body.twn-burger-open {
  overflow: hidden;
}

@keyframes twn-burger-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 374px) {
  .twn-burger {
    top: calc(env(safe-area-inset-top) + 76px);
    bottom: auto;
    gap: 8px;
    padding: 8px;
  }

  .twn-burger__scroll {
    gap: 8px;
  }

  .twn-burger__profile {
    min-height: 72px;
    padding: 12px;
  }

  .twn-burger__role-switch {
    margin: 0 12px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .twn-burger {
    animation: none;
  }
}
