body.portal-body.portal-ui-v2 .portal-header,
body.portal-body.portal-ui-v2 .portal-auth-header {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(129, 88, 96, 0.2);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 110;
}

body.portal-body.portal-ui-v2 .portal-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

body.portal-body.portal-ui-v2 .portal-topbar-left,
body.portal-body.portal-ui-v2 .portal-topbar-center,
body.portal-body.portal-ui-v2 .portal-header-actions {
  min-width: 0;
}

body.portal-body.portal-ui-v2 .portal-logo-link {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(132, 87, 95, 0.24);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 20px rgba(92, 54, 69, 0.14);
}

body.portal-body.portal-ui-v2 .portal-brand-logo,
body.portal-body.portal-ui-v2 .portal-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

body.portal-body.portal-ui-v2 .portal-brand-logo {
  border: 1px solid rgba(157, 111, 120, 0.36);
}

body.portal-body.portal-ui-v2 .portal-brand-mark {
  background: linear-gradient(150deg, #1f6a4f 0%, #134c38 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

body.portal-body.portal-ui-v2 .portal-topbar-unit {
  width: 100%;
  border: 0;
  border-radius: 14px;
  min-height: 44px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(132, 87, 95, 0.22);
  box-shadow: 0 10px 18px rgba(90, 52, 66, 0.12);
  text-decoration: none;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: 1px;
  cursor: pointer;
  transition:
    transform var(--portal-v2-motion) ease,
    box-shadow var(--portal-v2-motion) ease,
    border-color var(--portal-v2-motion) ease;
}

body.portal-body.portal-ui-v2 .portal-topbar-unit:hover {
  transform: translateY(-2px);
  border-color: rgba(132, 87, 95, 0.34);
  box-shadow: 0 12px 22px rgba(90, 52, 66, 0.18);
}

body.portal-body.portal-ui-v2 .portal-topbar-unit-name {
  font-size: 13px;
  font-weight: 800;
  color: #3e2830;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portal-body.portal-ui-v2 .portal-topbar-unit-meta {
  font-size: 10px;
  color: #705661;
  font-weight: 600;
}

body.portal-body.portal-ui-v2 .portal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

body.portal-body.portal-ui-v2 .portal-icon-btn {
  position: relative;
  height: 44px;
  min-width: 44px;
  border: 1px solid rgba(128, 84, 94, 0.28);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.84);
  color: #553f49;
  box-shadow: 0 10px 22px rgba(94, 56, 71, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    transform var(--portal-v2-motion) ease,
    box-shadow var(--portal-v2-motion) ease,
    border-color var(--portal-v2-motion) ease,
    color var(--portal-v2-motion) ease;
}

body.portal-body.portal-ui-v2 .portal-icon-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(122, 81, 91, 0.5);
  color: #3f2d35;
  box-shadow: 0 12px 24px rgba(94, 56, 71, 0.2);
}

body.portal-body.portal-ui-v2 .portal-icon-btn--notify {
  position: relative;
  overflow: visible;
}

body.portal-body.portal-ui-v2 .portal-notify-wrap {
  position: relative;
}

body.portal-body.portal-ui-v2 .portal-notify-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 10;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(140deg, #d06a8f 0%, #c99f4f 100%);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.95);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(208, 106, 143, 0.36);
  animation: portal-badge-bounce 340ms ease;
}

body.portal-body.portal-ui-v2 .portal-notify-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 92vw);
  border: 1px solid rgba(137, 90, 100, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 42px rgba(88, 49, 63, 0.22);
  backdrop-filter: blur(10px);
  padding: 10px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--portal-v2-motion) ease, transform var(--portal-v2-motion) ease;
  z-index: 220;
}

body.portal-body.portal-ui-v2 .portal-notify-dropdown.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

body.portal-body.portal-ui-v2 .portal-notify-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 8px;
  border-bottom: 1px solid rgba(136, 90, 99, 0.2);
}

body.portal-body.portal-ui-v2 .portal-notify-dropdown-head strong {
  color: #3d2830;
  font-size: 14px;
}

body.portal-body.portal-ui-v2 .portal-notify-dropdown-head a {
  font-size: 12px;
  color: #1d6a4f;
  text-decoration: none;
  font-weight: 700;
}

body.portal-body.portal-ui-v2 .portal-notify-empty {
  padding: 12px 8px 8px;
  color: #6c5360;
  font-size: 13px;
}

body.portal-body.portal-ui-v2 .portal-notify-list {
  display: grid;
  gap: 8px;
  max-height: min(50vh, 360px);
  overflow: auto;
  padding: 8px 4px 2px;
}

body.portal-body.portal-ui-v2 .portal-menu-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

body.portal-body.portal-ui-v2 .portal-menu-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #a06c7b 0%, #6f4d58 100%);
}

body.portal-body.portal-ui-v2 .portal-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(33, 20, 25, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--portal-v2-motion) ease;
}

body.portal-body.portal-ui-v2 .portal-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.portal-body.portal-ui-v2 .portal-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 90vw);
  height: 100dvh;
  z-index: 270;
  background: rgba(255, 255, 255, 0.92);
  border-left: 1px solid rgba(132, 87, 95, 0.24);
  box-shadow: -20px 0 34px rgba(70, 42, 53, 0.2);
  backdrop-filter: blur(14px);
  transform: translateX(102%);
  transition: transform var(--portal-v2-motion) ease;
  display: grid;
  grid-template-rows: auto 1fr;
  visibility: hidden;
  pointer-events: none;
}

body.portal-body.portal-ui-v2 .portal-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

body.portal-body.portal-ui-v2 .portal-drawer-head {
  padding: calc(14px + env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid rgba(132, 87, 95, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.portal-body.portal-ui-v2 .portal-drawer-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.portal-body.portal-ui-v2 .portal-drawer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #a06c7b 0%, #6f4d58 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
}

body.portal-body.portal-ui-v2 .portal-drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.portal-body.portal-ui-v2 .portal-drawer-user strong {
  display: block;
  color: #3e2931;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.portal-body.portal-ui-v2 .portal-drawer-user span {
  display: block;
  color: #6b515d;
  font-size: 11px;
}

body.portal-body.portal-ui-v2 .portal-drawer-nav {
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  overflow: auto;
}

body.portal-body.portal-ui-v2 .portal-drawer-nav a {
  text-decoration: none;
  border: 1px solid rgba(132, 87, 95, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  padding: 11px 12px;
  box-shadow: 0 8px 16px rgba(90, 51, 65, 0.12);
  transition: transform var(--portal-v2-motion) ease, box-shadow var(--portal-v2-motion) ease;
}

body.portal-body.portal-ui-v2 .portal-drawer-nav a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(90, 51, 65, 0.18);
}

body.portal-body.portal-ui-v2 .portal-drawer-nav strong {
  display: block;
  color: #3f2a31;
  font-size: 13px;
}

body.portal-body.portal-ui-v2 .portal-drawer-nav span {
  display: block;
  margin-top: 2px;
  color: #6a515c;
  font-size: 11px;
}

body.portal-body.portal-ui-v2 .portal-modal-card--unit {
  width: min(420px, 94vw);
}

body.portal-body.portal-ui-v2 .portal-modal-note {
  border-radius: 10px;
  border: 1px solid rgba(132, 87, 95, 0.25);
  background: rgba(255, 255, 255, 0.72);
  padding: 9px 10px;
  color: #5b444f;
  font-size: 12px;
}

body.portal-body.portal-ui-v2 .portal-auth-header {
  padding: 14px 16px 12px;
  justify-content: center;
}

@keyframes portal-badge-bounce {
  0% {
    transform: scale(0.74);
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@media (min-width: 900px) {
  body.portal-body.portal-ui-v2 .portal-header {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 12px 30px;
    border-radius: 0 0 24px 24px;
    border: 1px solid rgba(129, 88, 96, 0.22);
    border-top: 0;
  }

  body.portal-body.portal-ui-v2 .portal-auth-header {
    padding: 16px 20px 12px;
  }
}
