:root {
  --ig-account-orange: #ff6a00;
  --ig-account-copy: #eef4f7;
  --ig-account-muted: #93a2ab;
  --ig-account-line: rgba(146, 172, 187, .18);
  --ig-account-surface: rgba(7, 13, 18, .985);
}

[data-account-menu-host] { display: block; min-width: 44px; min-height: 44px; }
.ig-account-menu { position: relative; display: flex; min-width: 0; align-items: center; }

.ig-account-trigger {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) 16px; align-items: center; gap: 10px;
  min-width: min(238px, 30vw); max-width: min(310px, 36vw); min-height: 48px; padding: 4px 10px 4px 5px;
  border: 1px solid transparent; border-radius: 12px; color: var(--ig-account-copy);
  background: transparent; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.ig-account-trigger:hover,.ig-account-trigger:focus-visible,.ig-account-trigger[aria-expanded="true"] {
  border-color: var(--ig-account-line); background: rgba(255, 255, 255, .035); outline: none;
}
.ig-account-trigger-avatar {
  display: grid; width: 38px; height: 38px; place-items: center; overflow: hidden;
  border: 1px solid rgba(255, 106, 0, .48); border-radius: 50%; color: #fff;
  background: #17222a; font: 700 11px/1 Inter, sans-serif;
}
.ig-account-trigger-avatar img {
  display: block; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: inherit; object-fit: cover;
}
.ig-account-trigger-copy { display: grid; min-width: 0; gap: 3px; }
.ig-account-trigger-copy b,.ig-account-trigger-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-account-trigger-copy b { color: var(--ig-account-copy); font: 700 13px/1.15 Rajdhani, Inter, sans-serif; letter-spacing: .02em; }
.ig-account-trigger-copy small { color: var(--ig-account-muted); font: 500 10px/1.25 Inter, sans-serif; }
.ig-account-trigger-chevron { color: var(--ig-account-muted); font: 700 16px/1 Inter, sans-serif; transition: transform .18s ease; }
.ig-account-trigger[aria-expanded="true"] .ig-account-trigger-chevron { transform: rotate(180deg); }

.ig-account-popover {
  position: absolute; z-index: 140; top: calc(100% + 11px); right: 0;
  width: min(360px, calc(100vw - 28px)); max-height: min(620px, calc(100dvh - 96px));
  padding: 7px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--ig-account-line); border-radius: 15px;
  color: var(--ig-account-copy); background: var(--ig-account-surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .52); backdrop-filter: blur(18px);
  scrollbar-width: thin; scrollbar-color: rgba(255, 106, 0, .42) transparent;
  animation: ig-account-popover-in .18s ease both;
}
.ig-account-popover[hidden] { display: none !important; }
@keyframes ig-account-popover-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }

.ig-account-identity {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 12px;
  margin: 0 0 7px; padding: 11px 10px 14px; border-bottom: 1px solid var(--ig-account-line);
}
.ig-account-identity-avatar {
  display: grid !important; width: 44px !important; height: 44px !important; place-items: center !important; overflow: hidden;
  border: 1px solid rgba(255, 106, 0, .48); border-radius: 50%;
  color: #fff; background: #17222a; font: 700 12px/1 Inter, sans-serif;
}
.ig-account-identity-avatar img {
  display: block; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: inherit; object-fit: cover;
}
.ig-account-identity-copy { display: block !important; min-width: 0; color: inherit !important; background: transparent !important; }
.ig-account-identity b,.ig-account-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-account-identity b { color: var(--ig-account-copy); font: 700 15px/1.2 Rajdhani, Inter, sans-serif; letter-spacing: .02em; }
.ig-account-identity small { margin-top: 3px; color: var(--ig-account-muted); font: 500 11px/1.35 Inter, sans-serif; }

.ig-account-item {
  display: grid !important; grid-template-columns: 34px minmax(0, 1fr) !important;
  align-items: center !important; gap: 10px !important; width: 100% !important; min-height: 52px;
  padding: 9px 10px !important; border: 0 !important; border-radius: 9px !important;
  color: var(--ig-account-copy) !important; background: transparent !important;
  text-align: left !important; text-decoration: none !important; cursor: pointer;
}
.ig-account-item:hover,.ig-account-item:focus-visible {
  color: #fff !important; background: rgba(255, 255, 255, .05) !important;
  outline: 1px solid rgba(255, 106, 0, .34) !important; outline-offset: -1px;
}
.ig-account-item-icon {
  display: grid !important; width: 32px !important; height: 32px !important; place-items: center !important;
  border: 0 !important; border-radius: 8px !important; color: var(--ig-account-orange) !important;
  background: rgba(255, 106, 0, .1) !important;
}
.ig-account-item-icon svg {
  width: 17px !important; height: 17px !important; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.ig-account-item-copy { display: grid !important; min-width: 0; gap: 3px; }
.ig-account-item b,.ig-account-item small { display: block; overflow: hidden; text-overflow: ellipsis; }
.ig-account-item b { color: inherit; font: 600 13px/1.25 Inter, sans-serif !important; letter-spacing: 0 !important; }
.ig-account-item small { margin: 0 !important; color: var(--ig-account-muted) !important; font: 400 11px/1.4 Inter, sans-serif !important; }
.ig-account-item.is-signout { color: #ff9a62 !important; }
.ig-account-item.is-signout .ig-account-item-icon { color: #ff9a62 !important; background: rgba(255, 106, 0, .08) !important; }

@media (max-width: 1100px) {
  .ig-account-trigger { grid-template-columns: 38px 16px; min-width: 70px; max-width: 70px; }
  .ig-account-trigger-copy { display: none; }
}
@media (max-width: 900px) {
  .ig-account-popover { position: fixed; top: 72px; right: 12px; bottom: auto; left: auto; max-height: calc(100dvh - 84px); }
  .mobile-nav.open { max-height: calc(100dvh - 82px); overflow-y: auto; overscroll-behavior: contain; }
  .mobile-nav .ig-account-menu { display: grid; width: 100%; }
  .mobile-nav .ig-account-trigger { grid-template-columns: 38px minmax(0, 1fr) 16px; width: 100%; max-width: none; }
  .mobile-nav .ig-account-trigger-copy { display: grid; }
  .mobile-nav .ig-account-popover {
    position: static; width: 100%; max-height: none; margin-top: 8px;
  }
}
@media (max-width: 430px) {
  .ig-account-trigger { grid-template-columns: 38px; min-width: 48px; max-width: 48px; padding-inline: 4px; }
  .ig-account-trigger-chevron { display: none; }
  .ig-account-popover { left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 80px); }
  .mobile-nav.open { max-height: calc(100dvh - 70px); }
  .mobile-nav .ig-account-trigger { grid-template-columns: 38px minmax(0, 1fr) 16px; width: 100%; max-width: none; padding: 4px 10px 4px 5px; }
  .mobile-nav .ig-account-trigger-chevron { display: inline; }
  .mobile-nav .ig-account-popover { width: 100%; max-height: none; }
  .ig-account-item { min-height: 56px; }
  .ig-account-item b { font-size: 14px !important; }
  .ig-account-item small,.ig-account-identity small { font-size: 11px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ig-account-popover { animation: none; }
  .ig-account-trigger,.ig-account-trigger-chevron { transition: none; }
}
