/* Compact, single-row navigation. Account controls live in the avatar popover. */
.top-navigation { display: none; }
html body.platform { --app-header-height: 58px; --app-sidebar-width: 0px; font-size: 14px; }
html body.platform > header {
  display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 18px; height: var(--app-header-height); min-height: var(--app-header-height);
  position: sticky; top: 0; max-width: none; padding: 0 22px; border-bottom: 1px solid #26282a; background: #0e1011; z-index: 60;
}
html body.platform > header .brand { flex: 0 0 auto; padding: 0; margin: 0; }
html body.platform > header .brand-icon { width: 30px; height: 30px; margin: 0; background: transparent; color: #f4f4f5; }
html body.platform > header .brand-name, html body.platform > header .brand small,
html body.platform > header .app-breadcrumb { display: none; }
html body.platform > header .top-navigation {
  display: block; position: static; flex: 1 1 auto; min-width: 0; width: auto; height: auto;
  padding: 0; margin: 0; border: 0; background: transparent; overflow-x: auto; scrollbar-width: none;
}
.top-navigation::-webkit-scrollbar { display: none; }
html body.platform > header .top-navigation nav { display: flex; flex-flow: row nowrap; width: max-content; justify-self: start; justify-content: flex-start; gap: 22px; margin: 0; padding: 0; }
html body.platform > header .top-navigation nav button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0; flex: 0 0 auto;
  width: auto; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: none;
  color: #a1a3a6; font: 500 14px/1.2 "DM Sans", system-ui, sans-serif; white-space: nowrap;
}
html body.platform > header .top-navigation nav button > span:first-child { display: none; }
html body.platform > header .top-navigation nav button > span:last-child { display: inline; }
html body.platform > header .top-navigation nav button.active::before { display: none; }
html body.platform > header .top-navigation nav button:hover { color: #fff; }
html body.platform > header .top-navigation nav button.active { color: #d4ff27; background: none; }
html body.platform > header .header-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; margin: 0; }
html body.platform > header .header-actions > [data-view="tutorial"] { display: none; }
html body.platform > header #account-button {
  display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0;
  border: 2px solid #686b75; outline: 2px solid #25272b; outline-offset: 2px; border-radius: 50%;
  background: #e2e5e8; color: #25272b; font-size: 13px; font-weight: 700;
}
html body.platform > header #account-button[aria-expanded="true"] { outline-color: #d4ff27; }
html body.platform > header .app-header-search { display: flex; flex: 0 0 138px; height: 32px; padding: 0 8px; border: 0; background: none; }
html body.platform > header .app-header-search input { height: 30px; font-size: 12px; }
html body.platform > header .app-header-search svg { width: 16px; height: 16px; }
html body.platform .platform-layout { display: block; margin: 0; padding: 0; grid-template-columns: minmax(0,1fr); }
html body.platform .studio { width: 100%; min-width: 0; max-width: none; margin: 0; padding: 20px 24px; }
html body.platform .platform-bottom { display: none; }
html body.platform .studio .studio-top h2 { font-size: clamp(22px, 2vw, 28px); line-height: 1.2; letter-spacing: -.8px; }
html body.platform .dashboard-subtitle { font-size: 14px; }
html body.platform .dashboard-studio .visual-tool h3 { font-size: 17px !important; }
html body.platform .dashboard-studio .visual-tool p { font-size: 12px; white-space: normal; }
html body.platform .studio label { font-size: 13px; }
.header-actions .mobile-menu-open { display: none; }

/* Native popover handles outside click, Escape, and the top layer. */
#account-popover {
  position: fixed; inset: 68px 18px auto auto; margin: 0; width: 338px; max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 82px); overflow-y: auto; padding: 12px; border: 1px solid #303235; border-radius: 24px;
  background: #1b1d1f; color: #f5f5f5; box-shadow: 0 20px 65px #0008; font: 400 14px/1.4 "DM Sans", system-ui, sans-serif;
}
#account-popover::backdrop { background: transparent; }
#account-popover button { cursor: pointer; font: inherit; color: inherit; }
#account-popover button:focus-visible { outline: 2px solid #d4ff27; outline-offset: -2px; }
#account-popover .profile-summary { display: flex; align-items: center; gap: 13px; width: 100%; padding: 8px 6px 18px; border: 0; background: none; text-align: left; }
#account-popover .profile-avatar { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border: 3px solid #777b87; border-radius: 50%; background: #e2e5e8; color: #25272b; font-size: 20px; font-weight: 700; }
#account-popover .profile-summary > span:nth-child(2) { flex: 1; min-width: 0; }
#account-popover .profile-summary strong, #account-popover .profile-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-popover .profile-summary strong { font-size: 15px; font-weight: 600; }
#account-popover .profile-summary small { margin-top: 3px; color: #999da2; font-size: 12px; }
#account-popover .profile-summary > span:last-child { font-size: 24px; color: #999da2; }
#account-popover .header-wallet { display: grid; gap: 0; padding: 4px 14px; margin-bottom: 12px; border: 0; border-radius: 18px; background: #26282a; }
#account-popover .header-wallet[hidden], #account-popover [hidden] { display: none; }
#account-popover .header-wallet button { display: flex; align-items: center; width: 100%; gap: 9px; min-height: 54px; padding: 10px 0; border: 0; background: none; text-align: left; }
#account-popover .header-credit-balance::before { content: 'Créditos'; font-size: 14px; }
#account-popover .header-credit-balance::after { content: '›'; color: #999da2; font-size: 20px; }
#account-popover .header-credit-balance svg { display: none; }
#account-popover .header-credit-label { margin-left: auto; color: #c6c8cb; font-size: 12px; }
#account-popover .header-credit-label strong { color: #f5f5f5; font-size: 15px; font-weight: 500; }
#account-popover #header-credit-unit { font-size: 0; }
#account-popover #header-credit-unit::after { content: 'disponíveis'; font-size: 11px; }
#account-popover .header-buy-credits { border-top: 1px solid #3c3e41; }
#account-popover .header-buy-credits > span:first-child { display: grid; place-items: center; width: 22px; color: #d4ff27; font-size: 24px; }
#account-popover .header-buy-label { display: inline; font-size: 13px; }
#account-popover .header-buy-short { display: none; }
#account-popover .header-buy-credits::after { content: 'Comprar'; margin-left: auto; padding: 7px 12px; border-radius: 22px; background: var(--vv-accent); color: var(--vv-on-accent); font-size: 12px; font-weight: 600; }
#account-popover .profile-links { display: grid; gap: 2px; padding: 0 0 10px; border: 0; }
#account-popover .profile-links button, #account-popover .profile-logout { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 43px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14px; }
#account-popover .profile-links button:hover, #account-popover .profile-logout:hover { background: #292b2e; }
#account-popover svg { width: 19px; height: 19px; flex: 0 0 19px; color: #92969b; }
#account-popover .profile-logout { border-top: 1px solid #35373a; border-radius: 0 0 12px 12px; min-height: 50px; }
@media (max-width: 1279px) {
  html body.platform > header { gap: 14px; padding: 0 16px; }
  html body.platform > header .app-header-search { display: none; }
  html body.platform > header .top-navigation nav { gap: 19px; }
  html body.platform > header .top-navigation nav button { font-size: 13px; }
}
@media (max-width: 760px) {
  html body.platform { --app-header-height: 54px; }
  html body.platform > header { gap: 12px; padding: 0 12px; }
  html body.platform > header .top-navigation nav { gap: 17px; }
  html body.platform > header .header-actions { gap: 10px; }
  html body.platform > header .mobile-menu-open { display: block; width: 28px; min-height: 38px; padding: 0; margin: 0; border: 0; background: none; color: #b3b5b8; font-size: 0; }
  html body.platform > header .mobile-menu-open::before { content: '☰'; font-size: 18px; }
  html body.platform .studio { padding: 16px 12px; }
  #account-popover { inset: 62px 12px auto auto; max-height: calc(100dvh - 74px); }
}

/* Native disclosures keep the same destinations reachable by keyboard and touch. */
html body.platform > header .top-navigation { overflow: visible; }
html body.platform > header .top-navigation nav { align-items: center; }
.creation-nav-group { position: relative; }
.creation-nav-group > summary { display: flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; list-style: none; color: #a1a3a6; font-weight: 500; }
.creation-nav-group > summary::-webkit-details-marker { display: none; }
.creation-nav-group > summary::after { content: '⌄'; }
.creation-nav-group[open] > summary::after { content: '⌃'; }
.creation-nav-group.active > summary, .creation-nav-group > summary:hover { color: #d4ff27; }
.creation-nav-group > summary:focus-visible, .creation-nav-submenu :is(button,a):focus-visible { outline: 2px solid #d4ff27; outline-offset: 3px; border-radius: 4px; }
.creation-nav-submenu { position: absolute; top: 100%; left: 0; z-index: 65; min-width: 210px; padding: 8px; border: 1px solid #303235; border-radius: 12px; background: #1b1d1f; box-shadow: 0 12px 30px #0008; }
html body.platform > header .top-navigation nav .creation-nav-submenu :is(button,a) { display: flex; justify-content: flex-start; width: 100%; padding: 0 12px; border-radius: 7px; }
html body.platform > header .top-navigation nav .creation-nav-submenu :is(button,a):hover { background: #292b2e; }
.mobile-navigation .creation-nav-submenu { position: static; box-shadow: none; border: 0; margin-left: 14px; }
.mobile-navigation .creation-nav-group > summary { padding: 8px 12px; }
.mobile-navigation .creation-nav-group.active > summary { color: #d4ff27; }
@media (max-width: 760px) {
  html body.platform > header .top-navigation { display: none; }
  html body.platform > header .header-actions { margin-left: auto; }
}

/* User's final vector mark; keep the compact symbol on small screens. */
html body > header .brand .dm-brand-horizontal{display:block;width:auto;height:28px}
html body > header .brand .dm-brand-symbol{display:none;width:30px;height:30px}
@media(max-width:419px){html body > header .brand .dm-brand-horizontal{display:none}html body > header .brand .dm-brand-symbol{display:block}}

.creation-nav-submenu a { display:flex; align-items:center; min-height:44px; padding:10px 14px; color:inherit; font:inherit; text-decoration:none; border-radius:7px; }
body.platform :is(.top-navigation, .mobile-navigation) nav .creation-nav-submenu :is(button,a) { align-items: center; column-gap: 8px; }
.mobile-navigation nav .creation-nav-submenu button { padding-inline: 14px; }
body.platform .creation-nav-submenu .menu-item-icon { width: 17px; height: 17px; flex: none; color: #b296e0; }

@media (prefers-reduced-motion: no-preference) {
  .top-navigation .creation-nav-group[open] > .creation-nav-submenu {
    animation: studio-submenu-enter 160ms ease-out;
  }
  @keyframes studio-submenu-enter {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
