.product-topbar {
  min-height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--gov-border, #e1e5ec);
  display: flex;
  align-items: center;
  padding: 0 40px;
  box-sizing: border-box;
  position: relative;
  z-index: 50;
}

.product-brand {
  display: flex;
  align-items: center;
  flex: none;
  color: var(--gov-ink, #1a2230);
  text-decoration: none;
}

.product-brand .emblem {
  width: 26px;
  height: 26px;
  margin: 0 12px 0 0;
  background: var(--gov-red, #c8161d);
  color: #fff;
  display: grid;
  place-items: center;
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}

.product-brand .title {
  color: var(--gov-ink, #1a2230);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  white-space: nowrap;
}

.product-topbar .product-brand .title::after { content: none !important; }

.product-topbar .nav,
.product-topbar .product-nav {
  box-sizing: border-box;
  height: 56px;
  margin: 0 0 0 56px;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex: none;
  visibility: hidden;
  position: static;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.product-topbar .nav a,
.product-topbar .product-nav a {
  display: flex;
  align-items: center;
  flex: none;
  padding: 0 16px;
  color: var(--gov-ink-2, #4a5568);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.product-topbar .nav a:hover,
.product-topbar .product-nav a:hover {
  color: var(--gov-ink, #1a2230);
}

.product-topbar .nav a.active,
.product-topbar .product-nav a.active {
  color: var(--gov-red, #c8161d);
  border-bottom-color: var(--gov-red, #c8161d);
  font-weight: 600;
}

.product-head-right {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-user {
  display: flex;
  align-items: center;
  min-width: 0;
}

.ph-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.ph-avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0242b, #9c1014);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(200, 22, 29, .28);
}

.ph-avatar.staff {
  background: linear-gradient(135deg, #2a4eaa, #16266b);
  box-shadow: 0 2px 6px rgba(30, 58, 138, .28);
}

.ph-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.ph-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gov-ink, #1a2230);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.ph-sub {
  color: var(--gov-ink-3, #8b97ad);
  font-size: 11px;
  white-space: nowrap;
}

.ph-balance {
  position: relative;
  flex: none;
  min-height: 24px;
  padding: 3px 10px 3px 7px;
  border-radius: 12px;
  background: #fdecec;
  color: #c8161d;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  white-space: nowrap;
  box-sizing: border-box;
}

.ph-balance-svg {
  width: 17px;
  height: 17px;
  flex: none;
  overflow: visible;
  transform: rotate(-90deg);
}

.ph-balance-track,
.ph-balance-ring {
  fill: none;
  stroke-width: 2;
}

.ph-balance-track { stroke: rgba(200, 22, 29, .16); }

.ph-balance-ring {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-dasharray: 63;
  stroke-dashoffset: 63;
}

.ph-balance-label { font-weight: 500; }

.ph-balance-number {
  min-width: 1ch;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ph-balance-delta {
  position: absolute;
  left: 50%;
  top: -5px;
  opacity: 0;
  pointer-events: none;
  color: #c8161d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, 0);
}

.ph-balance.is-credit {
  background: #e9f8f1;
  color: #047857;
}

.ph-balance.is-credit .ph-balance-track { stroke: rgba(4, 120, 87, .16); }
.ph-balance.is-credit .ph-balance-delta { color: #047857; }

.ph-balance.is-animating {
  animation: ph-balance-bump .62s ease-out;
}

.ph-balance.is-animating .ph-balance-ring {
  animation: ph-balance-ring .78s ease-out forwards;
}

.ph-balance.is-animating .ph-balance-delta {
  animation: ph-balance-delta 1.15s ease-out forwards;
}

@keyframes ph-balance-ring {
  0% { stroke-dashoffset: 63; opacity: .35; }
  55% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -63; opacity: 0; }
}

@keyframes ph-balance-bump {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.06); }
}

@keyframes ph-balance-delta {
  0% { opacity: 0; transform: translate(-50%, 3px); }
  20% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -14px); }
}

.ph-divider {
  width: 1px;
  height: 18px;
  flex: none;
  background: var(--gov-border, #e1e5ec);
}

.ph-link {
  flex: none;
  padding: 4px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--gov-ink-2, #4a5568);
  text-decoration: none;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.ph-link:hover { background: var(--gov-bg, #f5f6f8); color: var(--gov-red, #c8161d); }

.product-health {
  flex: none;
  color: var(--gov-ink-3, #8b97ad);
  font-size: 11px;
  white-space: nowrap;
}

.product-health.online { color: var(--status-success, #047857); }
.product-health.offline { color: var(--gov-red, #c8161d); }

@media (max-width: 1180px) {
  .product-topbar { padding: 0 24px; }
  .product-topbar .nav,
  .product-topbar .product-nav { margin-left: 28px; }
  .product-topbar .nav a,
  .product-topbar .product-nav a { padding: 0 11px; }
  .ph-meta, .product-health { display: none; }
}

@media (max-width: 820px) {
  .product-topbar {
    min-height: 99px;
    padding: 0 16px;
    flex-wrap: wrap;
    align-content: flex-start;
  }
  .product-brand, .product-head-right { height: 56px; }
  .product-topbar .nav,
  .product-topbar .product-nav {
    order: 10;
    width: calc(100% + 32px);
    height: 43px;
    margin: 0 -16px;
    padding: 0 8px;
    overflow-x: auto;
    border-top: 1px solid var(--gov-divider, #edf0f4);
  }
  .product-topbar .nav a,
  .product-topbar .product-nav a {
    flex: 1 0 auto;
    justify-content: center;
    min-width: 72px;
    padding: 0 9px;
  }
  .ph-divider, .ph-link.member-link { display: none; }
}

@media (max-width: 520px) {
  .product-topbar { padding: 0 12px; }
  .product-topbar .nav,
  .product-topbar .product-nav {
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 0 4px;
  }
  .product-brand .emblem { margin-right: 8px; }
  .product-brand .title { font-size: 15px; }
  .ph-avatar { display: none; }
  .ph-balance { padding: 3px 7px 3px 5px; font-size: 11px; }
  .ph-balance-svg { width: 15px; height: 15px; }
  .ph-balance-number { font-size: 11px; }
  .ph-link { padding: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .ph-balance.is-animating,
  .ph-balance.is-animating .ph-balance-ring,
  .ph-balance.is-animating .ph-balance-delta { animation: none; }
  .ph-balance.is-animating .ph-balance-delta { display: none; }
}
