/* Shared account-center polish. Existing routes and action hooks stay unchanged. */
:root {
  --account-blue: #1268e8;
  --account-ink: #142b47;
  --account-muted: #6f8198;
  --account-line: #e1e8f1;
}

/* Header utilities read as one calm group instead of three bordered controls. */
.opc-topbar-right {
  gap: 3px !important;
  padding: 4px !important;
  border: 1px solid #e5ebf3;
  border-radius: 14px;
  background: #f8fafc;
}
.opc-top-message,
.community-notification-link {
  border-color: transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
}
.opc-top-message:hover,
.opc-top-message:focus-visible,
.community-notification-link:hover,
.community-notification-link:focus-visible {
  border-color: transparent !important;
  background: #eaf2ff !important;
}
.growth-summary-chip {
  min-height: 38px !important;
  padding: 4px 10px !important;
  border-color: transparent !important;
  background: transparent !important;
}
.growth-summary-chip:hover { background: #eaf2ff !important; }

/* Compact triggers: quiet at rest, highlighted only on interaction. */
.opc-account-menu > summary,
.community-account-menu > summary,
.molecule-account-menu > summary {
  min-height: 42px;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.opc-account-menu > summary:hover,
.community-account-menu > summary:hover,
.molecule-account-menu > summary:hover,
.opc-account-menu[open] > summary,
.community-account-menu[open] > summary,
.molecule-account-menu[open] > summary {
  border-color: #c9daf0 !important;
  background: #fff !important;
  box-shadow: 0 4px 14px rgba(34, 67, 105, .07) !important;
}
.opc-account-avatar,
.community-account-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  color: #fff !important;
  background: linear-gradient(145deg, #2478ed, #0d5dcb) !important;
  box-shadow: 0 4px 10px rgba(18, 104, 232, .2);
}
.molecule-account-dot {
  width: 32px !important;
  height: 32px !important;
  display: grid;
  place-items: center;
  border-radius: 50% !important;
  color: #fff;
  background: linear-gradient(145deg, #2478ed, #0d5dcb) !important;
  box-shadow: 0 4px 10px rgba(18, 104, 232, .2) !important;
}
.molecule-account-dot::before { content: "账"; font-size: 12px; font-weight: 800; }
.opc-account-copy .opc-rolebadge,
.community-account-menu > summary strong,
.molecule-account-copy small { color: var(--account-muted) !important; }
.opc-account-copy strong,
.molecule-account-copy strong { color: var(--account-ink) !important; }

@media (min-width: 901px) {
  .molecule-account-menu > summary { min-width: 164px; padding: 4px 9px 4px 5px !important; }
  .molecule-account-copy strong { max-width: 120px !important; }
  body.vnext-management-shell .opc-account-menu > summary {
    width: 194px;
    box-sizing: border-box;
  }
}

/* One consistent account center across workbench, home and community. */
.opc-account-popover,
.community-account-popover,
.molecule-account-popover {
  width: 344px !important;
  padding: 10px !important;
  border: 1px solid rgba(206, 217, 231, .92) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 22px 60px rgba(25, 49, 82, .17), 0 4px 14px rgba(25, 49, 82, .06) !important;
}
.opc-account-popover::before,
.molecule-account-popover::before {
  right: 24px !important;
  border-color: #d7e1ed !important;
}
.opc-account-summary,
.community-account-popover > div:first-child,
.molecule-account-summary {
  min-height: 72px;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  column-gap: 12px !important;
  row-gap: 1px !important;
  padding: 8px 10px 13px !important;
  border-bottom: 1px solid var(--account-line) !important;
}
.opc-account-summary::before,
.community-account-popover > div:first-child::before,
.molecule-account-summary::before {
  content: "账";
  width: 42px;
  height: 42px;
  display: grid;
  grid-column: 1;
  grid-row: 1 / 4;
  place-items: center;
  align-self: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #2478ed, #0d5dcb);
  box-shadow: 0 5px 14px rgba(18, 104, 232, .2);
  font-size: 14px;
  font-weight: 800;
}
.opc-account-summary > *,
.community-account-popover > div:first-child > *,
.molecule-account-summary > * { grid-column: 2; }
.opc-account-summary small,
.community-account-popover > div:first-child small,
.molecule-account-summary small {
  color: #8492a5 !important;
  font-size: 10px !important;
  font-weight: 600;
}
.opc-account-summary strong,
.community-account-popover > div:first-child strong,
.molecule-account-summary strong {
  color: var(--account-ink) !important;
  font-size: 16px !important;
  line-height: 1.3;
}
.opc-account-summary span,
.community-account-popover > div:first-child span,
.molecule-account-summary span {
  color: var(--account-muted) !important;
  font-size: 11px !important;
}

/* Icon + title + description rows, driven only by presentation attributes. */
[data-account-item] {
  min-height: 52px !important;
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 1px;
  margin-top: 3px !important;
  padding: 6px 9px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #28445f !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  line-height: 1.2;
}
[data-account-item]::before {
  content: "";
  width: 32px;
  height: 32px;
  grid-column: 1;
  grid-row: 1 / 3;
  border-radius: 9px;
  background-color: #edf4ff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 17px;
}
[data-account-item]::after {
  content: attr(data-menu-description);
  grid-column: 2;
  grid-row: 2;
  color: #8795a8;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
[data-account-item] > span { grid-column: 3; grid-row: 1 / 3; color: #8a9aad; }
[data-account-item]:hover,
[data-account-item]:focus-visible {
  color: var(--account-blue) !important;
  background: #f1f6ff !important;
  outline: 0 !important;
}
[data-account-item]:hover::before,
[data-account-item]:focus-visible::before { background-color: #dfecff; }
[data-menu-section="secondary"] {
  margin-top: 8px !important;
  border-top: 1px solid var(--account-line) !important;
  border-radius: 0 0 10px 10px !important;
}
[data-menu-icon="workspace"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231268e8' stroke-width='1.8'%3E%3Crect x='4' y='4' width='6' height='6' rx='1'/%3E%3Crect x='14' y='4' width='6' height='6' rx='1'/%3E%3Crect x='4' y='14' width='6' height='6' rx='1'/%3E%3Crect x='14' y='14' width='6' height='6' rx='1'/%3E%3C/svg%3E"); }
[data-menu-icon="community"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231268e8' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M5 15a6 6 0 1 1 3 2l-4 2 1-4Z'/%3E%3Cpath d='M14 7a5 5 0 0 1 5 8l1 3-3-1'/%3E%3C/svg%3E"); }
[data-menu-icon="tree"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231268e8' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 20V9m0 5-5-4m5 1 5-4'/%3E%3Ccircle cx='7' cy='8' r='3'/%3E%3Ccircle cx='17' cy='5' r='3'/%3E%3Ccircle cx='12' cy='7' r='3'/%3E%3Cpath d='M8 20h8'/%3E%3C/svg%3E"); }
[data-menu-icon="profile"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231268e8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21h16M6 21V8l6-4 6 4v13M9 11h6M9 15h6'/%3E%3C/svg%3E"); }
[data-menu-icon="security"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231268e8' stroke-width='1.8'%3E%3Crect x='5' y='10' width='14' height='10' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3m-4 4v3'/%3E%3C/svg%3E"); }
[data-menu-icon="messages"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231268e8' stroke-width='1.8'%3E%3Cpath d='M5 6h14v10H9l-4 3V6Z'/%3E%3Cpath d='M8 10h8m-8 3h5'/%3E%3C/svg%3E"); }
[data-menu-icon="home"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231268e8' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m4 11 8-7 8 7v9h-6v-6h-4v6H4v-9Z'/%3E%3C/svg%3E"); }
[data-menu-icon="logout"] {
  margin-top: 7px !important;
  border-top: 1px solid var(--account-line) !important;
  border-radius: 0 0 10px 10px !important;
  color: #a54040 !important;
}
[data-menu-icon="logout"]::before { background-color: #fff1f1; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b04444' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M10 5H5v14h5m4-3 4-4-4-4m4 4H9'/%3E%3C/svg%3E"); }
[data-menu-icon="logout"]:hover,
[data-menu-icon="logout"]:focus-visible { color: #9f3030 !important; background: #fff4f4 !important; }

@media (max-width: 900px) {
  .opc-topbar-right { padding: 2px !important; border-color: transparent; background: transparent; }
  .opc-account-popover,
  .community-account-popover,
  .molecule-account-popover {
    width: min(344px, calc(100vw - 20px)) !important;
    max-height: calc(100vh - 82px);
    overflow-y: auto;
  }
  [data-account-item] { min-height: 50px !important; }
}
